-
93. 크로아티아 알파벳Problem Solving 2023. 1. 19. 05:27728x90
https://www.acmicpc.net/problem/2941
2941번: 크로아티아 알파벳
예전에는 운영체제에서 크로아티아 알파벳을 입력할 수가 없었다. 따라서, 다음과 같이 크로아티아 알파벳을 변경해서 입력했다. 크로아티아 알파벳 변경 č c= ć c- dž dz= đ d- lj lj nj nj š s= ž z=
www.acmicpc.net
string replace 문제
string = input() if 'c=' in string: string = string.replace('c=', 'c') if 'c-' in string: string = string.replace('c-', 'c') if 'dz=' in string: string = string.replace('dz=', 'd') if 'd-' in string: string = string.replace('d-', 'd') if 'lj' in string: string = string.replace('lj', 'l') if 'nj' in string: string = string.replace('nj', 'n') if 's=' in string: string = string.replace('s=', 's') if 'z=' in string: string = string.replace('z=', 'z') print(len(string))
'Problem Solving' 카테고리의 다른 글
95. Sort Array By Parity II (0) 2023.01.19 94. Merge Sorted Array (1) 2023.01.19 92. Number of 1 Bits (0) 2023.01.19 91. Two Sum II - Input Array Is Sorted (0) 2023.01.19 90. Valid Parentheses (0) 2023.01.19