题解 | #字符串加密#

字符串加密

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

思路:构造对应表取值
key = input()
s = input()
res = ''
alp1 = 'abcdefghijklmnopqrstuvwxyz'
# 构造alp2,与alp1对相对应
alp2 = ''
for i in key + alp1: 
    if i not in alp2:
        alp2 += i
# 对应取值
for i in s:
    res += alp2[alp1.find(i)]
print(res)


全部评论

相关推荐

SHC2:春招先狠狠投递,然后你看看能不能申请香港新加坡的一年制master,花不了多少钱,或者现在赶紧去刷一段实习。HR专业考研没必要
点赞 评论 收藏
分享
船长想实习:我啥技术不会决定去试试,然后进去也不干活就搅局可以吗?
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务