4 回答
已采纳
lanchc
TA贡献3条经验 获得超8个赞
public class HelloWorld{ public static void main(String[] args) { int one = 10 ; int two = 20 ; int three = 0 ; three = one + two; System.out.println("three = one + two ==>"+three); three += one; System.out.println("three += one ==>"+three); three -= one; System.out.println("three -= one ==>"+three); three *= one; System.out.println("three *= one ==>"+three); three /= one; System.out.println("three /= one ==>"+three); three %= one; System.out.println("three %= one ==>"+three); } }
慕粉3291149
TA贡献71条经验 获得超52个赞
one=10 two=20
第一步 three = one + two = 10 + 20 = 30
第二步 three +=one 意思是 three = three + one= 30 + 10 = 40
第三步 three -= one 意思是 three = three - one = 40 - 10 = 30
第三步 three *= one 意思是 three = three*one = 30 * 10 = 300
第四步 three /= one 意思是 three = three/one = 300/30 = 10(这里/意思是除法 就是three除以one得到的商)
第五步 three %= one 意思是 three = three%one = 10%10 = 0 (这里%意思是取余 就是three除以one得到的余数)
添加回答
举报
0/150
提交
取消