解题思路:
很想吐槽,为什么用注释的部分就会错,蓝桥杯官网都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 人评分
时间转换 (Java代码)浏览:572 |
C语言程序设计教程(第三版)课后习题10.4 (C语言代码)浏览:665 |
兰顿蚂蚁 (C++代码)浏览:1044 |
WU-整除问题 (C++代码)浏览:611 |
WU-printf基础练习2 (C++代码)浏览:2000 |
C语言程序设计教程(第三版)课后习题3.7 (C语言代码)浏览:840 |
C语言训练-亲密数 (C语言代码)浏览:682 |
用筛法求之N内的素数。 (C语言代码)浏览:664 |
1113题解浏览:784 |
1017题解浏览:583 |