[백준] #2941 if문으로 예외 처리 python
2022. 12. 22. 17:13
https://www.acmicpc.net/problem/2941
too many if ~....
S = input()
if 'c=' in S:
S = S.replace('c=', '|')
if 'c-' in S:
S = S.replace('c-', '|')
if 'dz=' in S:
S = S.replace('dz=', '|')
if 'd-' in S:
S = S.replace('d-', '|')
if 'lj' in S:
S = S.replace('lj', '|')
if 'nj' in S:
S = S.replace('nj', '|')
if 's=' in S:
S = S.replace('s=', '|')
if 'z=' in S:
S = S.replace('z=', '|')
print(len(S))
'Programming > Algorithm' 카테고리의 다른 글
[백준] #1712 손익 분기점 python (0) | 2022.12.23 |
---|---|
[백준] #1316 그룹 단어 체커 python (0) | 2022.12.23 |
[백준] #5622 다이얼 python (0) | 2022.12.22 |
[백준] #2908 문자열 뒤집기 python (0) | 2022.12.22 |
[백준] #1152 단어 개수 python (0) | 2022.12.22 |