import scala.io.Source object LongLines { def processFile(filename: String, width: Int) { def processLine(line: String) { if (line.length > width) { println(filename +": "+ line) println(source) } } val source = Source.fromFile(filename) for (line <- source.getLines()) processLine(line) }}
Standard input is empty
Main.scala:8: error: forward reference extends over definition of value source println(source) ^ one error found spoj: The program compiled successfully, but Main.class was not found. Class Main should contain method: def main(args: Array[String]).
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!