-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path2490.java
More file actions
85 lines (72 loc) · 2.02 KB
/
2490.java
File metadata and controls
85 lines (72 loc) · 2.02 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
import java.io.*;
import java.util.StringTokenizer;
public class Main {
public static void main(String[] args) throws IOException {
new Solution().run();
}
}
class Solution {
private int[] arr = new int[4];
private InputClass inputClass = new InputClass();
private int T = 0;
public void run() throws IOException {
while(T<3) {
inputClass.input();
solve();
T++;
}
inputClass.close();
}
public void solve() throws IOException {
int len = arr.length;
int cnt = 0;
for(int i=0; i<len; i++) {
if(arr[i] == 0) {
cnt++;
}
}
switch(cnt) {
case 0:
inputClass.write('E');
break;
case 1:
inputClass.write('A');
break;
case 2:
inputClass.write('B');
break;
case 3:
inputClass.write('C');
break;
case 4:
inputClass.write('D');
break;
}
}
class InputClass {
private BufferedWriter bw;
private BufferedReader br;
private StringTokenizer st;
public InputClass() {
bw = new BufferedWriter(new OutputStreamWriter(System.out));
br = new BufferedReader(new InputStreamReader(System.in));
st = null;
}
private StringTokenizer getStringTokenizer() throws IOException {
return new StringTokenizer(br.readLine(), " ");
}
public void input() throws IOException {
st = getStringTokenizer();
for(int i=0; i<4; i++) {
arr[i] = Integer.parseInt(st.nextToken());
}
}
public void write(char content) throws IOException {
bw.write(content + "\n");
}
public void close() throws IOException {
bw.close();
br.close();
}
}
}