Skip to content

Instantly share code, notes, and snippets.

Created August 21, 2015 12:54
Show Gist options
  • Save anonymous/01bfa81d8d11ada954bb to your computer and use it in GitHub Desktop.
Save anonymous/01bfa81d8d11ada954bb to your computer and use it in GitHub Desktop.
import java.io.PrintStream
import scala.io.Source
object main extends App {
val inFile = "B-large-practice.in"
val outFile = "B-large-practice.out"
Console.setIn(Source.fromFile(inFile).bufferedReader())
Console.setOut(new PrintStream(outFile))
val lines = Console readInt()
for (i <- 1 to lines) {
val line = Console readLine()
Console print "Case #" + i + ": "
Console println (line.split(' ').reverse.mkString(" "))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment