凯撒加密

n = int(input())
new_sentence = ""
for c in sentence:
if c>="a" and c<="z":
new_sentence+= chr( ord('a') + ((ord(c)-ord('a')) + n )%26 )
elif c>="A" and c<="Z":
new_sentence+= chr( ord('A') + ((ord(c)-ord('A')) + n )%26 )
else:
new_sentence += c
print(new_sentence)

凯撒加密

 

上一篇:1974. 使用特殊打字机键入单词的最少时间


下一篇:第五天 键盘行