X-man

导航

hdu 2095 find your present (2)(^的有趣应用)

#include<stdio.h>
int main()
{
    int n;
    int tmp,x;
    while(scanf("%d",&n)!=EOF&&n!=0)
    {
        tmp=0;
        for(int i=0;i<n;i++)
        {
            scanf("%d",&x);
            tmp^=x;
            //printf("#%d\n",tmp);
        }
        printf("%d\n",tmp);
    }
    return 0;
}

 

posted on 2013-05-29 16:25  雨钝风轻  阅读(173)  评论(0编辑  收藏  举报