总时间限制:
1000ms
内存限制:
65536kB
描述
Given a sequence of N numbers. Find X that the number of X's in the sequence is odd.
输入
First line: one positive integers N (N <= 100).
Second line: N positive integers (<= 10000).
输出
One integer X.
样例输入
7 2 4 4 3 3 2 2
样例输出
2
#include<bits/stdc++.h>//Writed by Wangzhimin Date:2022.06.01
int a[1005];
int n;
using namespace std;
int main()
{
scanf("%d",&n);
for(int i=0;i<n;i++)
scanf("%d",&a[i]);
for(int i=0;i<n;i++)
{
if(a[i]%2==0)
{
printf("%d ",a[i]);
break;
}
}
return 0;
}