Input/Output for pairs of numbers: Difference between revisions

Content added Content deleted
No edit summary
m (→‎{{header|REXX}}: changed comments, added whitespace.)
Line 552: Line 552:
=={{header|REXX}}==
=={{header|REXX}}==
This version isn't limited to summing integers, any form of number that REXX supports can be used.
This version isn't limited to summing integers, any form of number that REXX supports can be used.
<lang rexx>/*REXX pgm reads a number (from C.L.), reads that # of pairs, writes their sum*/
<lang rexx>/*REXX pgm reads a number (from the CL), reads that number of pairs, & writes their sum.*/
/*all input is from the Command Line. */

do linein() /*read the number of pairs to be add*ed*/
do linein() /*read the number of pairs to be add*ed*/
y=linein() /*read a line (a record) from the input*/
$=linein() /*read a line (a record) from the C.L. */
say word(y,1) + word(y,2) /*write the sum of a pair of numbers. */
say word($, 1) + word($, 2) /*display the sum of a pair of numbers.*/
end /*linein() */ /*keep getting pairs of # (the 1st get)*/
end /*linein() */
/*stick a fork in it, we're all done. */</lang>

/*stick a fork in it, we're all done. */</lang>


=={{header|Ring}}==
=={{header|Ring}}==