凯撒密码 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)

 

 

 

 学号:2020310143012

昵称:苒若

 

posted @ 2021-09-13 22:13  苒若  阅读(21)  评论(0)    收藏  举报