-
Notifications
You must be signed in to change notification settings - Fork 0
/
크로아티아 알파벳.java
57 lines (41 loc) · 1.09 KB
/
크로아티아 알파벳.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String str = br.readLine();
int len = str.length();
int count = 0;
for (int i = 0; i < len; i++) {
char ch = str.charAt(i);
if(ch == 'c' && i < len - 1) {
if(str.charAt(i + 1) == '=' || str.charAt(i + 1) == '-') {
i++;
}
}
else if(ch == 'd' && i < len - 1) {
if(str.charAt(i + 1) == '-') {
i++;
}
else if(str.charAt(i + 1) == 'z' && i < len - 2) {
if(str.charAt(i + 2) == '=') {
i += 2;
}
}
}
else if((ch == 'l' || ch == 'n') && i < len - 1) {
if(str.charAt(i + 1) == 'j') {
i++;
}
}
else if((ch == 's' || ch == 'z') && i < len - 1) {
if(str.charAt(i + 1) == '=') {
i++;
}
}
count++;
}
System.out.println(count);
}
}