Input/Output for lines of text: Difference between revisions

Content added Content deleted
No edit summary
(Scala contribution added.)
Line 627: Line 627:
end</lang>
end</lang>


=={{header|Scala}}==
<lang Scala>// Input/Output for Lines of Text
object IOLines extends App {
private val in = scala.io.StdIn
private val n = in.readInt()

private def doStuff(word: String): Unit = println(word)

for (_ <- 0 until n) {
val word = in.readLine()
doStuff(word)
}
}</lang>
=={{header|Tcl}}==
=={{header|Tcl}}==
<lang tcl>proc do_stuff {line} {
<lang tcl>proc do_stuff {line} {