单独的数字

#include <iostream>
#include <string>
#include <cstdio>
#include <cmath>
#include <map>
#include <cstring>
#include <algorithm>
#define range(i,a,b) for(int i=a;i<=b;++i)
#define rerange(i,a,b) for(int i=a;i>=b;--i)
#define LL long long
#define fill(arr,tmp) memset(arr,tmp,sizeof(arr))
using namespace std;
map<int,int>MAP;
int n,tmp;
void init(){
    cin>>n;
    while(n--){
        cin>>tmp;
        MAP[tmp]++;
    }
}
void solve(){
    map<int,int>::iterator iter;
    for(iter=MAP.begin();iter!=MAP.end();++iter)
        if(iter->second==1){
        cout<<iter->first<<endl;
        return;
    }
}
int main(){
    init();
    solve();
    return 0;
}
View Code

猜你喜欢

转载自www.cnblogs.com/Rhythm-/p/9321294.html
今日推荐