题解 | #字符串加解密#
https://www.nowcoder.com/practice/2aa32b378a024755a3f251e75cbf233a
lis = [] while True: st = input() lis.append(st) if len(lis) == 2: break a = [] b = [] for i in lis[0]: if i.islower(): if i == 'z': i = 'A' a.append(i) else: a.append(chr(ord(i) + 1).upper()) elif i.isupper(): if i == 'Z': i = 'a' a.append(i) else: a.append(chr(ord(i) + 1).lower()) elif i.isdigit(): if i == '9': i = '0' a.append(i) else: a.append(str(int(i) + 1)) else: a.append(i) for i in lis[1]: if i.isupper(): if i == 'A': i = 'z' b.append(i) else: b.append(chr(ord(i) - 1).lower()) elif i.islower(): if i == 'a': i = 'Z' b.append(i) else: b.append(chr(ord(i) - 1).upper()) elif i.isdigit(): if i == '0': i = '9' b.append(i) else: b.append(str(int(i) - 1)) else: b.append(i) print(''.join(a)) print(''.join(b))