// // program to sum up numbers, entered from standard input // ending with "quit" def sum() : Int = { println("enter more numbers to add up, quit to stop") val n = readLine if (n == "quit") 0 else n.toInt + sum() } println("sum is " + sum)