int a,b;
a=1;
b=2;
a=a+b;可以简写为a+=b;//加
a=a-b;可以简写为a-=b;//减
a=a*b;可以简写为a*=b;//乘
a=a/b;可以简写为a/=b;//除
a=a%b;可以简写为a%=b;//取余运算,也可以简写。
a=a<<2;可以简写为a<<=2;//左移位运算。
a=a>>2;可以简写为a>>=2;//右移位运算,
a=a&b;可以简写为a&=b;//位与运算,
a=a|b;可以简写为a|=b;//位或运算,
a=a^b;可以简写为a^=b;//位异或运算,
简写后运算更快。
原文:https://www.cnblogs.com/bba123/p/12839593.html