标签:输出 c++ 出现 can break scan pat == ret
#include<cstdio>
int a[100010], HashTable[10010] = {0};
int main(){
int n, ans = -1;
scanf("%d", &n);
for(int i = 0; i < n; i++){
scanf("%d", &a[i]);
HashTable[a[i]]++;
}
for(int j = 0; j < n; j++){
if(HashTable[a[j]] == 1){//找出现一次的数字
ans = a[j];
break;
}
}
if(ans == -1) printf("None"); //找不到出现一次的数字,输出None
else printf("%d",ans);
return 0;
}
标签:输出 c++ 出现 can break scan pat == ret
原文地址:https://www.cnblogs.com/zjsaipplp/p/10425242.html