728x90
6750번: Rotating letters
An artist wants to construct a sign whose letters will rotate freely in the breeze. In order to do this, she must only use letters that are not changed by rotation of 180 degrees: I, O, S, H, Z, X, and N. Write a program that reads a word and determines wh
www.acmicpc.net
문제 풀이
입력되는 문자열 중 I, O, S, H, Z, X, N이 아닌 문자가 포함되어있는 경우, NO를 출력하고 아니라면 YES를 출력한다.
정답 코드
for i in input() :
if i not in ['I', 'O', 'S', 'H', 'Z', 'X', 'N'] :
print("NO")
exit(0)
print("YES")
728x90
'Algorithm > PS' 카테고리의 다른 글
[BOJ/백준] 6780 - Sumac Sequences [python] (0) | 2023.03.19 |
---|---|
[BOJ/백준] 6779 - Who Has Seen The Wind [python] (0) | 2023.03.19 |
[BOJ/백준] 6721 - Backward numbers [python] (0) | 2023.03.19 |
[BOJ/백준] 6437 - Golf [python] (0) | 2023.03.17 |
[BOJ/백준] 6378 - 디지털 루트 [python] (0) | 2023.03.17 |