Input/Output for pairs of numbers: Difference between revisions
Input/Output for pairs of numbers (view source)
Revision as of 14:11, 17 November 2017
, 6 years ago→{{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}}
|