一.使用+/-
int a = 1;
int b = 2;
a = a + b;
b = a - b;
a = a - b;
缺点:数值容易溢出
二.使用*和/
int a= 1;
int b = 2;
a = a * b;
b = a / b;
a = a / b
缺点:数值中不能有0
三.使用异或^
int a =1;
int b= 2;
a = a^b;
b = a^b;
a = a^b;
一.使用+/-
int a = 1;
int b = 2;
a = a + b;
b = a - b;
a = a - b;
缺点:数值容易溢出
二.使用*和/
int a= 1;
int b = 2;
a = a * b;
b = a / b;
a = a / b
缺点:数值中不能有0
三.使用异或^
int a =1;
int b= 2;
a = a^b;
b = a^b;
a = a^b;