橙汁梨儿
2021-04-12 20:49
这怎么写啊,有大佬给我示范一下么
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);
int one = 10 ;
int two = 20 ;
int three = 0 ;
int a=one+two;
System.out.println("three = one + two==> "+a);
System.out.println("three += one ==> "+(a+=one));
System.out.println("three -= one ==> "+(a-=one));
System.out.println("three *= one ==> "+(a*=one));
System.out.println("three /= one ==> "+(a/=one));
System.out.println("three %= one ==> "+(a%=one));
=,把等号右边的数据赋值给等号左边的变量或常量
+=,a += b,等效于:a = (a的数据类型)(a + (b));
-=,a -= b,等效于:a = (a的数据类型)(a - (b));
=,a = b,等效于:a = (a的数据类型)(a * (b));
/=,a /= b,等效于:a = (a的数据类型)(a / (b));
%=,a %= b,等效于:a = (a的数据类型)(a % (b));
Java入门第一季(IDEA工具)升级版
1165547 学习 · 17586 问题
相似问题