-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path2511.java
43 lines (40 loc) · 964 Bytes
/
2511.java
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
// 2511. 카드놀이
// 2019.08.23
// 입문용
import java.io.*;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String a[] = br.readLine().split(" ");
String b[] = br.readLine().split(" ");
int aScore = 0;
int bScore = 0;
int last = -1;
for (int i = 0; i < a.length; i++) {
if (Integer.parseInt(a[i]) > Integer.parseInt(b[i])) {
aScore += 3;
last = 0;
} else if (Integer.parseInt(a[i]) < Integer.parseInt(b[i])) {
bScore += 3;
last = 1;
} else {
aScore++;
bScore++;
}
}
System.out.println(aScore + " " + bScore);
if (aScore > bScore) {
System.out.println("A");
} else if (aScore < bScore) {
System.out.println("B");
} else {
if (last == 0) {
System.out.println("A");
} else if (last == 1) {
System.out.println("B");
} else {
System.out.println("D");
}
}
}
}