public class imooc33 { public static void main(String[] args){ int one=10; int two=20; int three=0; int a=one+two; int b=a+=one; int c=a-=one; int d=a*=one; int e=a/=one; int f=a%=one; System.out.println("three =one + two ==>"+a); System.out.println("three +=one ==>"+b); System.out.println("three -=one ==>"+c); System.out.println("three *=one ==>"+d); System.out.println("three /=one ==>"+e); System.out.println("three %=one ==>"+f); } }
3 回答
习惯受伤
TA贡献885条经验 获得超1144个赞
没错,最后答案就是0,计算f时当时的值是:
a = 30;
int f = a %= 10;
从右往左计算,先计算a %= 10,计算完 就是等于0
添加回答
举报
0/150
提交
取消