GPT答: |
7i24.cn
|
s = input("请输入获得的密文:")
plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
ciphertext = "DEFGHIJKLMNOPQRSTUVWXYZABC"
result = ""
for char in s:
if char.isalpha():
if char.islower():
index = plaintext.index(char.upper())
result += ciphertext[index].lower()
else:
index = plaintext.index(char)
result += ciphertext[index]
else:
result += char
print("解密后的明文为:" + result)
|