#30515: Python解


chiugt0817@gmail.com (Bonjour)

學校 : 臺北市立陽明高級中學
編號 : 157566
來源 : [223.136.30.133]
最後登入時間 :
2022-06-09 21:07:52

#我還想說這樣寫比較簡單 結果更複雜..
 
#想法
反正就是找max 然後移掉 再看剩餘的 兩個元素sum有沒有大於max
try:
  while True:
    dic ={0:"A", 1:"B", 2:"C"}
    list1 = [int(c) for c in input().split()]
    imax = list1.index(max(list1))
    Max =list1[imax] 
    list1[imax] = 0
    if Max>sum(list1):
      print(dic[imax]) 
    else:
      print(dic[list1.index(max(list1))])
except EOFError:
  pass
#53838: Re: Python解


elwin.lu0120@gmail.com (Elwin)

學校 : 臺中市私立明道高級中學
編號 : 273465
來源 : [36.232.12.65]
最後登入時間 :
2025-09-20 08:15:26

#我還想說這樣寫比較簡單 結果更複雜..
 
#想法
反正就是找max 然後移掉 再看剩餘的 兩個元素sum有沒有大於max
try:
  while True:
    dic ={0:"A", 1:"B", 2:"C"}
    list1 = [int(c) for c in input().split()]
    imax = list1.index(max(list1))
    Max =list1[imax] 
    list1[imax] = 0
    if Max>sum(list1):
      print(dic[imax]) 
    else:
      print(dic[list1.index(max(list1))])
except EOFError:
  pass

while True:
    try:
        l=list(map(int,input().split()))
        print(["A","B","C"][l.index(sum(l)-max(l)-min(l))] if sum(l)-max(l)>max(l) else ["A","B","C"][l.index(max(l))])
    except:
        break

#53839: Re: Python解


elwin.lu0120@gmail.com (Elwin)

學校 : 臺中市私立明道高級中學
編號 : 273465
來源 : [36.232.12.65]
最後登入時間 :
2025-09-20 08:15:26

#我還想說這樣寫比較簡單 結果更複雜..
 
#想法
反正就是找max 然後移掉 再看剩餘的 兩個元素sum有沒有大於max
try:
  while True:
    dic ={0:"A", 1:"B", 2:"C"}
    list1 = [int(c) for c in input().split()]
    imax = list1.index(max(list1))
    Max =list1[imax] 
    list1[imax] = 0
    if Max>sum(list1):
      print(dic[imax]) 
    else:
      print(dic[list1.index(max(list1))])
except EOFError:
  pass

while True:
    try:
        l=list(map(int,input().split()))
        print(["A","B","C"][l.index(sum(l)-max(l)-min(l))] if sum(l)-max(l)>max(l) else ["A","B","C"][l.index(max(l))])
    except:
        break


這樣更簡潔