题解 | #配置文件恢复#
配置文件恢复
https://www.nowcoder.com/practice/ca6ac6ef9538419abf6f883f7d6f6ee5
while True:
try:
order=list(input().split())
#一字串
if len(order)==1:
if order[0] in "reset":
print("reset what")
else:
print("unknown command")
#两字串
elif len(order)==2:
order_1=["reset","board","board","reboot","backplane"]
order_2=["board","add","delete","backplane","abort"]
count=0
ind=0
for i in range(len(order_1)):
if order[0] in order_1[i] and order[0][0]==order_1[i][0]:
if order[1] in order_2[i] and order[1][0]==order_2[i][0]:
count+=1
ind=i
if count==1:
put=["board fault","where to add","no board at all","impossible","install first"]
print(put[ind])
else:
print("unknown command")
except:
break
查看11道真题和解析