Input/Output for pairs of numbers: Difference between revisions

m
→‎{{header|Factor}}: updated to a proper command line program
m (→‎{{header|Factor}}: updated to a proper command line program)
Line 221:
=={{header|Factor}}==
<lang factor>
USING: io math.parser prettyprint sequences splitting ;
IN: rosetta-code.pair-output
 
: process-line ( str -- n )
" " split [ string>number ] map-sum ;
: main ( -- ) lines 1 tail [ process-line ] map [ . ] each ;
MAIN: main
</lang>
{{out}}
1,808

edits