Input/Output for pairs of numbers: Difference between revisions

Added Easylang
(added Arturo)
(Added Easylang)
 
(4 intermediate revisions by 4 users not shown)
Line 200:
=={{header|Arturo}}==
 
<syntaxhighlight lang="arturo">printLineprintNumbers: function [linenum]-> print line
print [num\0 "+" num\1 "=" num\0 + num\1]
 
lineCount: to :integer strip input ""
 
do.times:lineCount [
linenumbers: to [:integer] split.words input ""
printLineprintNumbers linenumbers
]</syntaxhighlight>
 
{{out}}
 
<pre>3
2 10
2 + 10 = 12
4 5
4 + 5 = 9
-123 45
-123 + 45 = -78</pre>
 
=={{header|AWK}}==
Line 382 ⟶ 393:
readln.split.to!(int[]).sum.writeln;
}</syntaxhighlight>
 
=={{header|EasyLang}}==
<syntaxhighlight>
n = number input
for i to n
a[] = number strsplit input " "
print a[1] + a[2]
.
input_data
5
1 2
10 20
-3 5
100 2
5 5
</syntaxhighlight>
{{out}}
<pre>
3
30
2
102
10
</pre>
 
 
=={{header|Factor}}==
Line 871 ⟶ 907:
10
>>> </syntaxhighlight>
 
=={{header|Quackery}}==
 
<syntaxhighlight lang="Quackery"> []
$ "How many pairs? " input
quackery times
[ $ "Pair "
i^ 1+ number$ join
$ ": " join input
join
$ " + echo cr " join ]
quackery</syntaxhighlight>
 
{{out}}
 
<pre>How many pairs? 5
Pair 1: 1 2
Pair 2: 10 20
Pair 3: -3 5
Pair 4: 100 2
Pair 5: 5 5
3
30
2
102
10
</pre>
 
=={{header|Racket}}==
Line 955 ⟶ 1,018:
102
10
</pre>
 
=={{header|RPL}}==
« 1 "How many pairs" "" INPUT STR→ '''FOR''' j
"Enter pair #" j + "" INPUT STR→ +
'''NEXT'''
» '<span style=color:blue">TASK</span>' STO
{{out}}
<pre>
5: 3
4: 30
3: 2
2: 102
1: 10
</pre>
 
Line 1,040 ⟶ 1,117:
=={{header|Wren}}==
This assumes that both Stdin and Stdout are connected to a terminal.
<syntaxhighlight lang="ecmascriptwren">import "io" for Stdin
 
var output = Fn.new { |pairs| pairs.each { |p| System.print(p[0] + p[1]) } }
2,060

edits