1 solutions
-
0
Java :
import java.util.Scanner; public class Main { public static void main(String[] args) { // TODO 自动生成的方法存根 Scanner input = new Scanner(System.in); int n = input.nextInt(); int i = 1; String A = input.next(); double scoreA = input.nextDouble(); double scoreB = scoreA; String B = A; if (n == 1) { System.out.print(A); } else { while (i < n) { String C = input.next(); double scoreC = input.nextDouble(); if (scoreC > scoreA) { scoreB = scoreA; B = A; scoreA = scoreC; A = C; } else { if (scoreC > scoreB) { scoreB = scoreC; B = C; } } i = i + 1; } System.out.print(A +" " + B); } } }
- 1
Information
- ID
- 18581
- Time
- 1000ms
- Memory
- 128MiB
- Difficulty
- (None)
- Tags
- # Submissions
- 0
- Accepted
- 0
- Uploaded By