题解 | #简单密码#

简单密码

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

# 20240911
dic = {
    '1':1,
    'abc':2,
    'def':3,
    'ghi':4,
    'jkl':5,
    'mno':6,
    'pqrs':7,
    'tuv':8,
    'wxyz':9,
    '0':0
}
s = input()
ss = ''
for i in s:
    if i.isupper():
        if i == 'Z':
            print('a',end='')
        else:
            print(chr(ord(i.lower())+1),end='')
        
    elif i.islower():
        for k in dic:
            if i in k:
                print(dic[k],end='')
                break
    else:
        print(i,end='')

全部评论

相关推荐

饼子吃到撑:学院本是这样的,找工作拼运气,你技术再好人家筛选学历照样沉入海底,海投就行了
点赞 评论 收藏
分享
04-28 15:42
郑州大学 C++
找工作勤劳小蜜蜂:网易这几个月在大面积裁员,外包岗全退,今年网易收缩严重,建议慎重考虑网易
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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