#题中有说明要从首字母开始匹配,所以匹配时不能用in!!! while 1: try: a=input().split() #将命令分开存到列表 except: break else: s=[] if len(a)==1: if a[0]=='reset'[:len(a[0])]: print('reset what') continue else: print('unknown command') continue elif len(a)==2: if a[0] == 'reset'[:len(a[0])]: if a[1] == 'board'[:len(a[1])]: s.append('board fault') if a[0] == 'board'[:len(a[0])]: if a[1] == 'add'[:len(a[1])]: s.append('where to add') if a[1] == 'delete'[:len(a[1])]: s.append('no board at all') if a[0] == 'reboot'[:len(a[0])]: if a[1] == 'backplane'[:len(a[1])]: s.append('impossible') if a[0] == 'backplane'[:len(a[0])]: if a[1] == 'abort'[:len(a[1])]: s.append('install first') if len(s)==0 or len(s)>1: print('unknown command') else: print(s[0])