-
Notifications
You must be signed in to change notification settings - Fork 95
Expand file tree
/
Copy path3.5.cpp
More file actions
36 lines (31 loc) · 772 Bytes
/
3.5.cpp
File metadata and controls
36 lines (31 loc) · 772 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
* 题目名称:找最小数
* 题目来源:北京邮电大学复试上机题
* 题目链接:http://t.cn/E9gekWa
* 代码作者:杨泽邦(炉灰)
*/
#include <iostream>
#include <cstdio>
#include <climits>
using namespace std;
const int INF = INT_MAX;
struct point {
int x, y;
};
int main() {
int n;
while (scanf("%d", &n) != EOF) {
point mininum;
mininum.x = INF;
mininum.y = INF;
for (int i = 0; i < n; ++i) {
point current;
scanf("%d%d", ¤t.x, ¤t.y);
if (current.x< mininum.x || (current.x == mininum.x && current.y < mininum.y)) {
mininum = current;
}
}
printf("%d %d\n", mininum.x, mininum.y);
}
return 0;
}