题解 | #字符串加密#
import sys
def encry(line):
line=line.lower()
new_line=[]
for c in line:
if c not in new_line:
new_line.append(c)
# print(new_line)
alpha=list('abcdefghijklmnopqrstuvwxyz')
temp=new_line.copy()
for c in alpha:
if c not in temp:
new_line.append(c)
return dict(zip(alpha, new_line))
pwd_dict={}
for i, line in enumerate(sys.stdin):
line=line.strip()
if i %2==0:
pwd_dict=encry(line)
else:
result=[pwd_dict[c] for c in line]
print(''.join(result))