一般交换我们都会用 int t=a; int a=b; int b=t; 今天学了一种新的方法 a = a^b; b = a^b; a = a^b; 一般不建议使用,主要学习一下异或 0^a = a a&a = 0