题目链接:https://vjudge.net/problem/HDU-1563
学会异或运算(位运算)
1 #include <cstdio> 2 #include <cstring> 3 #include <cmath> 4 #include <iostream> 5 #include <algorithm> 6 #include <string> 7 #include <cstdlib> 8 9 using namespace std; 10 11 int main() 12 { 13 int t,s,m; 14 while(scanf("%d",&t),t) 15 { 16 m=0; 17 while(t--) 18 { 19 scanf("%d",&s); 20 m^=s; 21 } 22 printf("%d ",m); 23 } 24 } 25