#27950: 請問哪裡有錯?


song93119@gmail.com (SSS)

學校 : 不指定學校
編號 : 162821
來源 : [36.237.39.199]
最後登入時間 :
2023-12-27 20:22:06
g275. 1. 七言對聯 -- 2021年9月APCS | From: [111.251.79.95] | 發表日期 : 2021-11-06 21:11

第1筆測試資料,我用電腦Python3.6.6,手動一行一行輸入做測試都沒問題,但用解題系統的測試執行都會失敗(第2、3筆測試都有通過)

請問出了什麼問題?

 

n=int(input())

 

c1=[0,0,0,0,0,0,0]

c2=[0,0,0,0,0,0,0]

 

for i in range (1,n+1,1) :

 

    a1=input('')

    a2=input("")

    b1=a1.split(" ")

    b2=a2.split(" ")

 

    for s in range (0,7,1) :

        c1[s]=int(b1[s])

        c2[s]=int(b2[s])

 

    if c1[1]==c1[3] or c1[1]!=c1[5] or c2[1]==c2[3] or c2[1]!=c2[5]:

        print("A",end="")

    if c1[6]!=1 or c2[6]!=0:

        print("B",end="")

    if c1[1]==c2[1] or c1[3]==c2[3] or c1[5]==c2[5]:

        print("C",end="")

    if c1[1]!=c1[3] and c1[1]==c1[5] and c2[1]!=c2[3] and c2[1]==c2[5] and c1[6]==1 and c2[6]==0 and c1[1]!=c2[1] and c1[3]!=c2[3] and c1[5]!=c2[5]:

        print("None")

 
#27964: Re:請問哪裡有錯?


cges30901 (cges30901)

學校 : 不指定學校
編號 : 30877
來源 : [101.136.203.77]
最後登入時間 :
2024-04-07 15:34:14
g275. 1. 七言對聯 -- 2021年9月APCS | From: [180.217.234.235] | 發表日期 : 2021-11-07 09:25

第1筆測試資料,我用電腦Python3.6.6,手動一行一行輸入做測試都沒問題,但用解題系統的測試執行都會失敗(第2、3筆測試都有通過)

請問出了什麼問題?

 

n=int(input())

 

c1=[0,0,0,0,0,0,0]

c2=[0,0,0,0,0,0,0]

 

for i in range (1,n+1,1) :

 

    a1=input('')

    a2=input("")

    b1=a1.split(" ")

    b2=a2.split(" ")

 

    for s in range (0,7,1) :

        c1[s]=int(b1[s])

        c2[s]=int(b2[s])

 

    if c1[1]==c1[3] or c1[1]!=c1[5] or c2[1]==c2[3] or c2[1]!=c2[5]:

        print("A",end="")

    if c1[6]!=1 or c2[6]!=0:

        print("B",end="")

    if c1[1]==c2[1] or c1[3]==c2[3] or c1[5]==c2[5]:

        print("C",end="")

    if c1[1]!=c1[3] and c1[1]==c1[5] and c2[1]!=c2[3] and c2[1]==c2[5] and c1[6]==1 and c2[6]==0 and c1[1]!=c2[1] and c1[3]!=c2[3] and c1[5]!=c2[5]:

        print("None")


因為你輸出後沒有換行

 
ZeroJudge Forum