题解 | #字符串加密#
字符串加密
https://www.nowcoder.com/practice/e4af1fe682b54459b2a211df91a91cf3
while True: try: key = input() word = input() stack = [] for c in key: if c not in stack: stack.append(c) for i in range(ord('a'), ord('z') + 1): if chr(i) not in stack: stack.append(chr(i)) res = '' for i in word: id = ord(i) - ord('a') res += stack[id] print(res) except: break