题解 | 字符串加密

字符串加密

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

while True:
    try:  
        kmp = input()
        txt = input()
        cip =  "".join(dict.fromkeys(kmp + "abcdefghijklmnopqrstuvwxyz"))
        ans = "".join(cip[ord(ch) - ord('a')] for ch in txt)
        print(ans)
    except:
        break



全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

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