题解 | #找最小数#
找最小数
https://www.nowcoder.com/practice/ba91786c4759403992896d859e87a6cd
#include <iostream>
using namespace std;
#include<cstdio>
#include<algorithm>
struct two{
int x;
int y;
};
two arr[1000];
bool compare(two p,two q){
if(p.x==q.x) return (p.y<q.y);
else return p.x<q.x;
}
int main() {
int n, b;
while (cin >> n) { // 注意 while 处理多个 case
for(int i=0;i<n;i++){
cin>>arr[i].x>>arr[i].y;
}
sort (arr,arr+n,compare);
cout<<arr[0].x<<" "<<arr[0].y<<endl;
}}
// 64 位输出请用 printf("%lld")

