方法一:
int a = 8;
int b = 31;
int temp;
temp = a;
a = b;
b = temp;
方法二:
int a = 8;
int b = 31;
int sum;
sum = a + b;
b = sum - b;
a = sum - b;
方法三:
int a = 8;
int b = 31;
a = a ^ b;
b = a ^ b;
a = a ^ b;
方法一:
int a = 8;
int b = 31;
int temp;
temp = a;
a = b;
b = temp;
方法二:
int a = 8;
int b = 31;
int sum;
sum = a + b;
b = sum - b;
a = sum - b;
方法三:
int a = 8;
int b = 31;
a = a ^ b;
b = a ^ b;
a = a ^ b;