Input/Output for pairs of numbers: Difference between revisions

Added Easylang
(fixed implementation + added output)
(Added Easylang)
 
(3 intermediate revisions by 3 users not shown)
Line 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 882 ⟶ 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 966 ⟶ 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,051 ⟶ 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]) } }
1,983

edits