forked from tkggft/JavaClassicInterviewQuestions
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain3.java
More file actions
28 lines (25 loc) · 652 Bytes
/
Main3.java
File metadata and controls
28 lines (25 loc) · 652 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
package ST;
import java.util.Scanner;
/**
* @auther: WJoe
* @Description:
* @Date : 19:52 2018/9/7
*/
public class Main3 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int n = scanner.nextInt();
int[][] ints = new int[2][n];
int max = Integer.MIN_VALUE;
int maxindex = 0;
for (int i = 0; i < n; i++) {
ints[0][i] = scanner.nextInt();
ints[1][i] = scanner.nextInt();
if (ints[0][i] > max) {
max = ints[0][i];
maxindex = i;
}
}
System.out.println(max);
}
}