Anthony has collected a large amount of sticks for manufacturing chopsticks. In order to simplify his job, he wants to fetch two equal-length sticks for machining at a time. After checking it over, Anthony finds that it is always possible that only one stick is left at last, because of the odd number of sticks and some other unknown reasons. For example, Anthony may have three sticks with length 1, 2, and 1 respectively. He fetches the first and the third for machinning, and leaves the second one at last. Your task is to report the length of the last stick.
The input file will consist of several cases.
Each case will be presented by an integer n (1 <= n <= 100, and n is odd) at first. Following that, n positive integers will be given, one in a line. These numbers indicate the length of the sticks collected by Anthony.
The input is ended by n = 0.
For each case, output an integer in a line, which is the length of the last stick.
题意是对于给定的n（n为奇数）根木棒，其中有n - 1根是可以按长度配对的，找出按长度配对后剩余的一根木棒。
（3）对于任意的x，都满足如下公式：x Xor 0 = x， x Xor x = 0。而且异或操作是满足交换律和结合律的，因此所有配对的木棒异或后结果为0，因此将所有木棒的长度异或后得到的结果即为不成对的那根木棒的长度，时间复杂度为O(n)。
郭嵩山、张子臻、王磊、汤振东著 国际大学生程序设计竞赛例题解（五） 电子工业出版社