def checka(a,b,c,d,e,f):
if a!=b and a==c and d!=e and d==f:
return False
else:
return True
def checkb(a,b):
if a==1 and b==0 :
return False
else:
return True
def checkc(a,b,c,d,e,f):
if a==b:
return True
if c==d:
return True
if e==f:
return True
else:
return False
n=int(input())
dic={}
antirule=[]
for i in range(n*2):
dic[i]=list(map(int,input().split()))
i+=1
for m in range(0,n*2,2):
if m<=n:
if checka(dic[m][1],dic[m][3],dic[m][5],dic[m+1][1],dic[m+1][3],dic[m+1][5]):
antirule.append("A")
if checkb(dic[m][6],dic[m+1][6]):
antirule.append("B")
if checkc(dic[m][1],dic[m+1][1],dic[m][3],dic[m+1][3],dic[m][5],dic[m+1][5]):
antirule.append("C")
if len(antirule)==0:
print("None")
else:
print(''.join(antirule))
antirule=[]
因為你把後面的資料篩掉了,測試明明就很有問題
試試這個,我只是把範例測資全部合併成一個,改開頭的對聯數量,其他複製貼上
4 |
預期應輸出
AC |
用你的版本去跑,只會顯示三組對聯的結果,因為最後一組被你篩掉了,直接跳過