表达式到底要怎么写啊。。。。。。求助~
我看了一下你的问题 不知道你现在是否还在困惑
但是 three的值确实是在一直变化的 第一步变成了30
第二步 30+10 变成 40
第三步 40-10 变成30
第四步30*10 变成300
第五步300/10成了30
第六步 30%10 成了0
下一步的three 是上一步的计算结果
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);
}
}
three=one+two;
System.out.println(three);
three+=one;
System.out.println(three);
three-=one;
System.out.println(three);
three*=one;
System.out.println(three);
three/=one;
System.out.println(three);
three%=one;
System.out.println(three);