为什么我的输出值不一样
我的输出最后会变成 第一个为40 第二个为30然后300.。。。。
2017-05-11
{
public static void main (String[]arge){
int o = 10 ;
int p = 20 ;
int a = (o+p); //a=30
int b = (a+=o); //a=40 b=40,此时a的值已改变
int c = (b-=o); //b=30 c=30,此时b值已改变
long d = (c*=o); //c=300 d=300,此时c值已改变
long e = (d/=o); //d=30 e=30,此时d值已改变
long f = (e%=o);//e=0 f=0
System.out.println("three = one + two ==>"+a); //输出值为改变后的值40
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);
}
}
举报