至少要清楚两种实现方式: 第一种:(注意越界) a = a + b; b = a - b; a = a - b; 第二种:(对参数类型有要求,只能对int,char) a = a ^ b; b = a ^ b; a = a ^ b;