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==>"+(one+two));
System.out.println("three+=one==>"+(three+one));
System.out.println("three-=one==>"+(three+one-one));
System.out.println("three*=one==>"+(three*one));
System.out.println("three/=one==>"+(three*one/one));
System.out.println("three%=one==>"+three%one);
你注意一下题目的要求和输出结果,题目要求的输入结果:

题目的要求是three这个变量每次都要被重新赋值,并作为下一次的输入项。但是你这里的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);
}
}