어렵지않다.. 어렵게 생각해서 짜면 손해다
힌트는 어떤 크로아티아 알파벳이든 1글자로 치환이 된다.
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class b2941 {
public static void main(String[] args) throws IOException {
BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
String[] arrStr = new String[] {"c=", "c-", "dz=", "d-", "lj", "nj", "s=", "z="};
String str = bf.readLine();
for (String s : arrStr) {
if (str.contains(s)) {
str = str.replace(s, "a");
}
}
System.out.println(str.length());
}
}
'백준 문제풀이' 카테고리의 다른 글
[백준] 14235번 (0) | 2024.07.13 |
---|---|
[백준]7568번 (0) | 2024.04.29 |
[백준]2164번 (0) | 2024.04.22 |
[백준]11718 (0) | 2024.04.21 |
[백준] 1009번 (0) | 2024.04.20 |