恺撒密码 B

s = input()
t = ""
for c in s:
if 'a' <= c <= 'z':
t += chr( ord('a') + ((ord(c)-ord('a')) + 3 )%26 )
elif 'A'<=c<='Z':
t += chr( ord('A') + ((ord(c)-ord('A')) + 3 )%26 )
else:
t += c
print(t)

posted @ 2021-09-14 14:21  饭果果  阅读(47)  评论(0)    收藏  举报