Skip to content

Instantly share code, notes, and snippets.

@waynejo
Created August 21, 2015 12:57
Show Gist options
  • Save waynejo/768acece66222860deda to your computer and use it in GitHub Desktop.
Save waynejo/768acece66222860deda to your computer and use it in GitHub Desktop.
package Main
import java.io.{FileOutputStream, FileInputStream}
import scala.annotation.tailrec
import scala.io.StdIn
object Main extends App {
Console.setIn(new FileInputStream("example.in"))
Console.setIn(new FileInputStream("B-large-practice.in"))
Console.setOut(new FileOutputStream("B-large-practice.out"))
def solve(s:String) = s.split(' ').reverse.mkString(" ")
val cases = StdIn.readLine().toInt
(1 to cases) foreach { n =>
println(s"Case #$n: ${solve(StdIn.readLine())}")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment