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
提交
取消