-
Notifications
You must be signed in to change notification settings - Fork 0
/
HOLES
40 lines (37 loc) · 876 Bytes
/
HOLES
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
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
class HOLES {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int T = Integer.parseInt(br.readLine());
while (T-- > 0) {
int holes = 0;
while (true) {
char c = (char) br.read();
//for (char c : br.readLine().toCharArray()) {
/*
if (c == 'B') {
holes += 2;
} else if (c == 'A' || c == 'D' || c == 'O' || c == 'P' || c == 'Q' || c == 'R') {
holes++;
}
*/
if (c < 'O') {
if (c < 'E') {
if (c == 'A' || c == 'D') {
holes++;
} else if (c == 'B') {
holes += 2;
} else if (c == '\n') {
break;
}
}
} else if (c < 'S') {
holes++;
}
}
System.out.println(holes);
}
}
}