#32461: 為什麼會是WA (python)


JimTsao (LIANG)

學校 : 臺北市立大理高級中學
編號 : 200115
來源 : [49.158.46.207]
最後登入時間 :
2022-10-23 08:20:09
d980. 11479 - Is this the easiest problem? -- UVa11479 | From: [27.247.68.73] | 發表日期 : 2022-10-13 13:21

x=int(input())

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

 y=list(map(int,input().split()))

 y.sort()

 if (y[0]+y[1]<y[2])or(y[0]<=0)or(y[1]<=0)or(y[2]<=0):

  print("Case ",i,": Invalid",sep="")

 elif (y[0]==y[1])and(y[1]==y[2]):

   print("Case ",i,": Equilateral",sep="")

 elif (y[0]==y[1])or(y[1]==y[2]):

   print("Case ",i,": Isosceles",sep="")

 else:

   print("Case ",i,": Scalene",sep="")

 
#32462: Re: 為什麼會是WA (python)


asnewchien@gmail.com (david)

學校 : 不指定學校
編號 : 68108
來源 : [114.42.146.197]
最後登入時間 :
2024-05-03 16:06:58
d980. 11479 - Is this the easiest problem? -- UVa11479 | From: [61.223.46.169] | 發表日期 : 2022-10-13 15:20

  • Isosceles  - 恰有兩邊等長  <-- 這個狀況。
 
#32464: Re: 為什麼會是WA (python)


cges30901 (cges30901)

學校 : 不指定學校
編號 : 30877
來源 : [101.136.203.77]
最後登入時間 :
2024-04-07 15:34:14
d980. 11479 - Is this the easiest problem? -- UVa11479 | From: [118.160.194.12] | 發表日期 : 2022-10-13 19:43

 

 if (y[0]+y[1]<y[2])or(y[0]<=0)or(y[1]<=0)or(y[2]<=0):

 


y[0]+y[1]剛好等於y[2]也無法形成三角形

 
#32480: Re: 為什麼會是WA (python)


JimTsao (LIANG)

學校 : 臺北市立大理高級中學
編號 : 200115
來源 : [49.158.46.207]
最後登入時間 :
2022-10-23 08:20:09
d980. 11479 - Is this the easiest problem? -- UVa11479 | From: [49.158.46.207] | 發表日期 : 2022-10-15 12:14

 

 if (y[0]+y[1]

 


y[0]+y[1]剛好等於y[2]也無法形成三角形


AC了!!謝謝<3

 
ZeroJudge Forum