题解 | #字符串加密#
字符串加密
http://www.nowcoder.com/practice/e4af1fe682b54459b2a211df91a91cf3
while True:
try:
a = input().lower()
original_code = input()
a = list(dict.fromkeys(a))
b = [chr(i) for i in range(ord('a'),ord('z')+1,1)]
c = b.copy()
for i in a:
c.remove(i)
code = a + c
translate_code = []
for j in original_code:
translate_code.append(code[b.index(j)])
print(''.join(translate_code))
except:
break