题解 | #密码翻译#
密码翻译
https://www.nowcoder.com/practice/136de4a719954361a8e9e41c8c4ad855
while True: try: tdata=list(map(list,input().strip().split())) list1=[] for i in range(len(tdata)): for j in range(len(tdata[i])): if 'a'<=tdata[i][j]<'z': tdata[i][j]=chr(ord(tdata[i][j])+1) elif 'A'<=tdata[i][j]<'Z': tdata[i][j]=chr(ord(tdata[i][j])+1) elif tdata[i][j]=='a': tdata[i][j]='A' elif tdata[i][j]=='z': tdata[i][j] = 'Z' list1.append(''.join(tdata[i])) for i in range(len(list1)): print(list1[i],end=' ') except EOFError: break