Created
August 21, 2015 12:57
-
-
Save waynejo/768acece66222860deda to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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