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 |
<lang rexx>/*REXX pgm reads a number (from the CL), reads that number of pairs, & writes their sum.*/ |
||
⚫ | |||
do linein() /*read the number of pairs to be add*ed*/ |
do linein() /*read the number of pairs to be add*ed*/ |
||
$=linein() /*read a line (a record) from the C.L. */ |
|||
say word( |
say word($, 1) + word($, 2) /*display the sum of a pair of numbers.*/ |
||
end /*linein() |
end /*linein() */ |
||
/*stick a fork in it, we're all done. */</lang> |
|||
⚫ | |||
=={{header|Ring}}== |
=={{header|Ring}}== |