题解 | #字符串加密#

字符串加密

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

key = input().strip()
target = input().strip()
alphabet = [chr(x) for x in range(97, 123)]
keyalphabet = []
result = ''
for k in key:
    if k not in keyalphabet:
        keyalphabet.append(k)
for s in alphabet:
    if s not in keyalphabet:
        keyalphabet.append(s)
for t in target:
    result += keyalphabet[alphabet.index(t)]
print(result)

全部评论

相关推荐

11-05 07:29
贵州大学 Java
点赞 评论 收藏
分享
点赞 收藏 评论
分享
牛客网
牛客企业服务