Find your present!
Time limit:1000/1000 MS (java/others) Memory limit:32768/32768 K (java/others)
Total submission (s): 3096 Accepted Submission (s): 2051
Problem DescriptionIn The New Year party, everybody'll 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 the them would be yo Urs. Each present have a card number on it, and your present ' s card number would be the one that different from all the others. For example, there is 5 present, and their card numbers are 1, 2, 3, 2, 1.so your present would be is the one with the card n Umber of 3, because 3 is the number, which different from all the others.
Inputthe input file would consist of several cases.
Each case would be presented by an integer n (1<=n<=200, and n are odd) at first. Following that, n positive integers would be is given in a line. These numbers indicate the card numbers of the PRESENTS.N = 0 ends the input.
Outputfor each case, output an integer with a line, which is the card number of your present.
Sample Input
51 1 3 2 231 2 10
Sample Output
32
Continue to be bored ..... Qingming morning unexpectedly under the university, sunny so good I also really served the Northeast climate. Buy two pieces of clothes on the net feel good ^ ^ ^ tomorrow it is time to reply to Class! It's not going to be a damn study.
#include <iostream>using namespace Std;int main () {int n;int ls[201];while (cin>>n,n) {int count[201]={0}; for (int i=0;i<n;i++) cin>>ls[i];for (int. k=0;k<n;k++) for (int j=0;j<n;j++) if (ls[k]==ls[j]) count[k]++; for (int m=0;m<n;m++) if (count[m]==1) Cout<<ls[m]<<endl;} return 0;}
Hangzhou Electric HDU ACM 1563 Find your present!