백준
[백준] 5598 - 카이사르 암호 (파이썬)
탈탈99
2022. 1. 5. 17:37
반응형
1. 문제
2. 코드
s = input()
for ch in s:
temp = ord(ch)
temp -= 3
if temp < 65:
temp += 89
if temp > 90:
temp -= 63
print(chr(temp), end='')
3. 풀이
ord(character --> int(ascii))와 chr(int --> character)만 알고 있다면 쉽게 해결할 수 있다.
728x90
반응형