s = input() for c in s: if c == ' ': print(' ', end='') else: if c.isupper(): print(chr((ord(c) - 65 + 3) % 26 + 65), end='') else: print(chr((ord(c) - 97 + 3) % 26 + 97), end='')

假设用户可能使用的输入为英文字母和空格请编写一个程序对输入字符串进行凯撒密码加密直接输出结果其中空格不用进行加密处理。【样例输入】python is good【样例输出】sbwkrq lv jrrg

原文地址: http://www.cveoy.top/t/topic/hokC 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录