慕仔5362173
2020-03-30 17:32
public class HelloWorld{
public static void main(String[] args) {
int one = 10 ;
int two = 20 ;
int three = 0 ;
int three1 = one + two ;
System.out.println("three=one+two==>"+three1) ;
int three2 += one ;
System.out.println("three+=one==>"+three2) ;
int three3 -= one ;
System.out.println("three-=one==>"+three3) ;
int three4 *= one ;
System.out.println("three*=one==>"+three4) ;
int three5 /= one ;
System.out.println("three/=one==>"+three5) ;
int three6 %= one ;
System.out.println("three%=one==>"+three6 ) ;
}
}
你可以这样写只输出一个three变量,每一行按three += one; System.out.println(three);这样的形式就可以了
Java入门第一季(IDEA工具)升级版
1165171 学习 · 17581 问题
相似问题