#include <iostream>
#include <string>
#include <sstream>
#include <cstring>
using namespace std;
int a[100001];
int main(){
memset(a, 0, 100001);
int n;
cin >> n;
cin.get();
string s;
int max = -1, min = 100000;
for (int i=0; i<n; i++) {
getline(cin, s);
stringstream steam(s);
int temp;
while (steam >> temp) {
max = temp > max ? temp : max;
min = temp < min ? temp : min;
a[temp] ++;
}
}
int id_m, id_n;
for (int i=min; i<=max; i++) {
if (a[i] == 0) {
id_m = i;
}
if (a[i] == 2) {
id_n = i;
}
}
cout << id_m << " " << id_n << endl;
return 0;
}
历届试题 错误票据
猜你喜欢
转载自blog.csdn.net/LoverJuan/article/details/88750791
今日推荐
周排行