点击运行
var num1:number = 10 var num2:number = 2 var res:number = 0 res = num1 + num2 console.log("加: "+res); res = num1 - num2; console.log("减: "+res) res = num1*num2 console.log("乘: "+res) res = num1/num2 console.log("除: "+res) res = num1%num2 console.log("余数: "+res) num1++ console.log("num1 自增运算: "+num1) num2-- console.log("num2 自减运算: "+num2)
运行结果 :
正在执行...