object HelloWorld { def totalSelectedValues(values: List[Int], selector : Int => Boolean) = { var total = 0 for( e <- values) { if (selector(e)) total +=e } total } def main(args: Array[String]) { val listOfValues = List(1, 2, 4, 5, 6, 7, 8) println(totalSelectedValues(listOfValues, {e => true})) }}
Standard input is empty
/opt/scala/bin/scalac: line 50: /dev/null: Permission denied 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!