思路分析: 对一组数据异或,一个数异或一次在异或一次相当于没异或 代码示例: #include<stdio.h> int main() { int a[5] = { 1, 1, 3 ,3, 2 }; int res = 0; for (int i = 0; i < 5; ++i) { res ^= a[i]; } printf("%d\n", res); system("pause"); return 0; }