package COM.HelloWorld;
public class Jiafa {
public static void main(String[] args){
int one = 10 ;
int two = 20 ;
int three = 0 ;
intthree=one+two;
int three1=three+=one;
int three2=three1-=one;
int three3=three2*=one;
int three4=three3/=one;
int three5=three4%=one;
System.out.println(three);
System.out.println(three1);
System.out.println(three2);
System.out.println(three3);
System.out.println(three4);
System.out.println(three5);
}
}
前面用int定义了three后面就不需要重新定义了,而且后面定义的时候中间还没有空格键
int 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);