解题思路:
很想吐槽,为什么用注释的部分就会错,蓝桥杯官网都ac了,,,之后只有改为这个
注意事项:
参考代码:
#include<iostream>
#include<sstream>
#include<cstring>
#include<cmath>
#include<string>
#include<algorithm>
#include <map>
using namespace std;
int n;
map<int,int> ma;
int main(){
cin >> n;
/*string str;
getchar();
for(int i = 0; i < n; i++){
getline(cin,str);
stringstream ss(str);
int tmp;
while(ss >> tmp){
if(!ma.count(tmp)) ma[tmp] = 1;
else ma[tmp]++;
}
}*/
int tmp;
while(cin >> tmp){
if(!ma.count(tmp)) ma[tmp] = 1;
else ma[tmp]++;
}
int fir = ma.begin()->first;
int que,cho;
for(map<int,int>::iterator it = ma.begin(); it != ma.end(); it++){
//cout << it->first << " " << fir<< endl;
if(it->first != fir){ que = fir; fir++;}
if(it->second == 2) cho = fir;
fir++;
}
cout << que << " " << cho << endl;
return 0;
}
0.0分
0 人评分
C二级辅导-进制转换 (C语言代码)浏览:788 |
点我有惊喜!你懂得!浏览:2072 |
母牛的故事 (C语言代码)浏览:743 |
C语言程序设计教程(第三版)课后习题10.2 (C语言代码)浏览:1086 |
C语言训练-求1+2!+3!+...+N!的和 (C语言代码)浏览:2468 |
C语言程序设计教程(第三版)课后习题7.2 (C语言代码)浏览:619 |
上车人数 (C语言代码)浏览:781 |
【亲和数】 (C语言代码)浏览:503 |
C语言训练-尼科彻斯定理 (C语言代码)浏览:468 |
WU-格式化数据输出 (C++代码)浏览:1212 |