-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path5622
More file actions
55 lines (42 loc) · 1.46 KB
/
5622
File metadata and controls
55 lines (42 loc) · 1.46 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
import java.io.*;
import java.math.BigInteger;
import java.util.*;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
// 문자열로 받고 문자열로 받은 것을 문자로 하나씩 인식해서 그 인식 번호가 w는 9번 -> 스위치문 써서 더해줌
String s = br.readLine();
int count =0;
int t = s.length();
for (int i = 0; i < t; i++) {
switch (s.charAt(i)) {
case 'A' : case 'B': case 'C' :
count += 3;
break;
case 'D' : case 'E': case 'F' :
count += 4;
break;
case 'G' : case 'H': case 'I' :
count += 5;
break;
case 'J' : case 'K': case 'L' :
count += 6;
break;
case 'M' : case 'N': case 'O' :
count += 7;
break;
case 'P' : case 'Q': case 'R' : case 'S' :
count += 8;
break;
case 'T' : case 'U': case 'V' :
count += 9;
break;
case 'W' : case 'X': case 'Y' : case 'Z' :
count += 10;
break;
}
}
System.out.println(count);
}
}
//