题解 | #配置文件恢复#

配置文件恢复

http://www.nowcoder.com/practice/ca6ac6ef9538419abf6f883f7d6f6ee5

while True:
    try:
        s = input().split()
        if len(s) == 1:
            if 'reset'.startswith(s[0]):
                print("reset what")
            else:
                print("unknown command")
        elif len(s) == 2:
            if 're'.startswith(s[0]) and s[1] == 'b':
                print("unknown command")
            elif 'reset'.startswith(s[0]) and 'board'.startswith(s[1]):
                print("board fault")
            elif 'reboot'.startswith(s[0]) and 'backplane'.startswith(s[1]):
                print("impossible")
            elif 'b'==s[0] and 'a'==s[1]:
                print("unknown command")
            elif 'board'.startswith(s[0]) and 'add'.startswith(s[1]):
                print("where to add")
            elif 'board'.startswith(s[0]) and 'delete'.startswith(s[1]):
                print("no board at all")
            elif 'backplane'.startswith(s[0]) and 'abort'.startswith(s[1]):
                print("install first")
            else:
                print("unknown command")
        else:
            print("unknown command")
    except:
        break
全部评论

相关推荐

自由水:这HR已经很好了,多的是已读不回和不读了
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务