sicily stick

两个数异或之后为0

#include<iostream>

#include<cstdio>
using namespace std;
int main()
{
int n;
while(scanf("%d",&n),n){
    int s = 0;
    int tmp;
    for(int i = 0;i<n;i++){
        scanf("%d",&tmp);
        s^=tmp;
    }
    cout <<s<<endl;
}
return 0;
}

你可能感兴趣的:(sicily stick)