-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJ05009.java
More file actions
48 lines (40 loc) · 1.15 KB
/
J05009.java
File metadata and controls
48 lines (40 loc) · 1.15 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
import java.util.*;
class ThiSinh {
private int mts;
private String ten;
private String ns;
private double d;
public ThiSinh(int mts, String ten, String ns, double d) {
this.mts = mts;
this.ten = ten;
this.ns = ns;
this.d = d;
}
public double getD() {
return d;
}
public String toString() {
return this.mts + " " + this.ten + " " + this.ns + " " + this.getD();
}
}
public class J05009 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
ArrayList<ThiSinh> a = new ArrayList<>();
double diemMax = -1;
for (int i = 1; i <= t; i++) {
sc.nextLine();
ThiSinh x = new ThiSinh(i, sc.nextLine(), sc.nextLine(), sc.nextDouble() + sc.nextDouble() + sc.nextDouble());
a.add(x);
if (x.getD() > diemMax) {
diemMax = x.getD();
}
}
for (ThiSinh x : a) {
if (diemMax == x.getD()) {
System.out.println(x);
}
}
}
}