*[백준/파이썬] 2941번 크로아티아 알파벳
생각보다 코드가 너무 간단했다.# 크로아티아 알파벳croatia_alphabet = ['dz=', 'lj', 'nj', 'c=', 'c-', 'd-', 's=', 'z=']word = input()# 크로아티아 알파벳 개수 세기for i in croatia_alphabet: word = word.replace(i, '*')# 최종 개수 출력print(len(word))잘못된 코드# 크로아티아 알파벳croatia_alphabet = ['dz=', 'lj', 'nj', 'c=', 'c-', 'd-', 's=', 'z=']word = input()cnt = 0# 크로아티아 알파벳 개수 세기for i in croatia_alphabet: while i in word: cnt += 1 ..
2025. 5. 9.