iOS-InterviewQuestion-collection
iOS-InterviewQuestion-collection copied to clipboard
[计算题][第二题]交换两个变量 不太对
int a = 5;
int b = 10;
正解应该是
a ^= b;
b ^= a;
a ^=b;
考察的是按位异或操作的原理
这个题的出处是大学时候 C程序设计(第四版) 谭浩强 课后习题 作业