源代码:
点击运行
object Test { def main(args: Array[String]) { var a = 10; var b = 20; var c = 25; var d = 25; println("a + b = " + (a + b) ); println("a - b = " + (a - b) ); println("a * b = " + (a * b) ); println("b / a = " + (b / a) ); println("b % a = " + (b % a) ); println("c % a = " + (c % a) ); } }
运行结果