解题思路:
很想吐槽,为什么用注释的部分就会错,蓝桥杯官网都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语言程序设计教程(第三版)课后习题9.3 (Java代码)浏览:981 |
C语言程序设计教程(第三版)课后习题5.7 (C语言代码)浏览:630 |
三角形 (C++代码)递推浏览:775 |
Cylinder (C语言描述,蓝桥杯)浏览:1255 |
1908题解浏览:656 |
C语言程序设计教程(第三版)课后习题8.4 (C语言代码)浏览:578 |
哥德巴赫曾猜测 (C语言代码)浏览:732 |
小九九 (C语言代码)浏览:521 |
C语言程序设计教程(第三版)课后习题7.4 (C语言代码)浏览:3247 |
简单的a+b (C语言代码)浏览:659 |