2 条题解
-
0
def encrypt(text): encrypted_text = "" for char in text: # 计算加密后的字符,注意处理字母表的循环 if 'a' <= char <= 'z': new_char = chr(((ord(char) - ord('a') + 4) % 26) + ord('a')) elif 'A' <= char <= 'Z': new_char = chr(((ord(char) - ord('A') + 4) % 26) + ord('A')) else: new_char = char encrypted_text += new_char return encrypted_text # 输入字符串 input_text = input() # 输出加密后的字符串 output_text = encrypt(input_text) print(output_text) # 输出: Glmre
- 1
信息
- ID
- 516
- 时间
- 1000ms
- 内存
- 64MiB
- 难度
- 6
- 标签
- 递交数
- 113
- 已通过
- 37
- 上传者