题解 | #简单密码#

简单密码

https://www.nowcoder.com/practice/7960b5038a2142a18e27e4c733855dac

strx = ""
litter = "abcdefghijklmnopqrstuvwxyza"
litterMap = {"2":["a","b","c"], "3":["d","e","f"], "4":["g","h","i"], 
            "5":["j","k","l"], "6":["m","n","o"], "7":["p","q","r","s"],
            "8":["t","u","v"], "9":["w","x","y","z"]}
for s in input():
    if s.isupper():
        strx += litter[litter.find(s.lower()) + 1]
    elif s.islower():
        for i in litterMap:
            if s in litterMap[i]:
                strx += i
                break
    else:
        strx += s
print(strx)

全部评论

相关推荐

11-24 11:23
门头沟学院 C++
点赞 评论 收藏
分享
11-01 08:48
门头沟学院 C++
伤心的候选人在吵架:佬你不要的,能不能拿户口本证明过户给我。。球球了
点赞 评论 收藏
分享
10-27 17:26
东北大学 Java
点赞 评论 收藏
分享
点赞 收藏 评论
分享
牛客网
牛客企业服务