程序博客网 > 欧洲历史书籍 知乎
来源:互联网 发布:欧洲历史书籍 知乎 编辑:程序博客网 时间:2024/06/05 00:10
import sys for L in sys.stdin: line=L.split() if line[0]=='ENDOFINPUT' and len(line)==1: break if line[0]=='START' and len(line)==1: continue if line[0]=='END' and len(line)==1: continue for i in range(len(L)): if L[i].isupper(): if ord(L[i])>=ord('F'): sys.stdout.write(chr(ord(L[i])-5)) else: sys.stdout.write(chr(ord(L[i])+21)) else: sys.stdout.write(L[i])