题解 | #简单密码#

简单密码

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)

全部评论

相关推荐

xxxxOxo:这公司幽默得很,要了简历半天一点动静都没有,过一会就给你发个邮件让你做测试,做完又没后文了,纯溜人
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务