题解 | #句子反转#

简单密码

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

while True:
    try:
        str_ = input()
        string = ''
        for s in str_:
            if s.isupper():
                if s == "Z":
                    s = 'a'
                else:
                    s = chr(ord(s.lower())+1)
            elif s.islower():
                if s == 's' or s == 'v' or s == 'y' or s == 'z':
                    s = str((ord(s) - ord('a')) // 3 + 1)
                else:
                    s = str((ord(s) - ord('a')) // 3 + 2)
            string += s
        print(string)
    except:
        break
全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

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