题解 | #简单密码#

简单密码

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)

全部评论

相关推荐

996的工作制还是没能硬啃下去,快要面试怂了,取消了
牛客80700350...:很正常,不是所有人都能接受这种强度的。不叫怯战,这叫明智
点赞 评论 收藏
分享
牛马43373018...:这人真懂什么叫熵吗
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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