题解 | #字符串加密#

字符串加密

https://www.nowcoder.com/practice/e4af1fe682b54459b2a211df91a91cf3

table=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
s=input()
m=input()
table2=[]
for each in s:
    if each not in table2:
        table2.append(each)
        continue
for each in table:
    if each not in table2:
        table2.append(each)
find={}
for i in range(26):
    key=table[i]
    value=table2[i]
    find[key]=value
put=[]
for each in m:
    put.append(find[each])

print("".join(put))

建立字典

全部评论

相关推荐

totoroyyw:千年老妖😂
投递华为等公司10个岗位
点赞 评论 收藏
分享
点赞 收藏 评论
分享
牛客网
牛客企业服务