Input/Output for pairs of numbers: Difference between revisions

Content added Content deleted
(Scala contribution added.)
Line 649: Line 649:
end</lang>
end</lang>


=={{header|Tcl}}==
=={{header|Scala}}==
<lang Scala>object IOPairs extends App {
private val in = scala.io.StdIn
private val n = in.readInt()


for (_ <- 0 until n) {
val Array(a, b) = in.readLine().split(" ").map(_.toInt)

def doStuff(a: Long, b: Long): Long = a + b

println(doStuff(a, b))
}

}
</lang>
=={{header|Tcl}}==
<lang tcl>gets stdin n
<lang tcl>gets stdin n
while {$n > 0} {
while {$n > 0} {