问题2296--find your present(找到你的礼物)

2296: find your present(找到你的礼物)

时间限制: 1 Sec  内存限制: 128 MB
提交: 2  解决: 2
[提交] [状态] [讨论版] [命题人:]

题目描述

In the new year party, everybody will get a "special present".Now it's your turn to get your special present, a lot of presents now putting on the desk, and only one of them will be yours.Each present has a card number on it, and your present's card number will be the one that different from all the others, and you can assume that only one number appear odd times.For example, there are 5 present, and their card numbers are 1, 2, 3, 2, 1.so your present will be the one with the card number of 3, because 3 is the number that different from all the others.
大意:
在新年晚会上,每个人都会得到一份“特别的礼物”。现在轮到你拿到你的特别礼物了,桌子上放着很多礼物,只有一件是你的。每份礼物上都有一个卡号,你的礼物的卡号将与其他所有礼物的卡号不同,你可以假设只有一个数字出现奇数次。例如,有5个礼物,他们的卡号是1,2,3,2,1。所以你的礼物将是卡号为3的礼物,因为3是与其他所有礼物不同的数字。

输入

The input file will consist of several cases.
Each case will be presented by an integer n (1<=n<1000000, and n is odd) at first. Following that, n positive integers will be given in a line, all integers will smaller than 2^31. These numbers indicate the card numbers of the presents.n = 0 ends the input.
大意:
输入文件将由几个案例组成。
每种情况首先将由整数n(1<=n<1000000,n为奇数)表示。接下来,n个正整数将在一行中给出,所有整数都小于2^31。这些数字表示礼物的卡号。n=0结束输入。

输出

For each case, output an integer in a line, which is the card number of your present.
大意:对于每种情况,在一行中输出一个整数,即您礼物的卡号。

样例输入 Copy

5
1 1 3 2 2
3
1 2 1
0

样例输出 Copy

3
2

来源/分类