#36496: 簡單寫APCS


ozasd6565@gmail.com (Z O)

學校 : 不指定學校
編號 : 238164
來源 : [220.157.125.174]
最後登入時間 :
2024-03-16 19:43:48
b964. 1. 成績指標 -- 2016年3月apcs | From: [58.114.119.29] | 發表日期 : 2023-07-19 15:08

n = input()
score = input()

score = score.split(' ')
score = [int(i) for i in score]
bestcase = []
worstcase = []
for i in score:
    if i >= 60:
        bestcase.append(i)
    elif i < 60:
        worstcase.append(i)
        
score.sort()
print(*score)bestcase.sort()
worstcase.sort()

if len(bestcase) == 0:
    print(worstcase[-1])
    print('worst case')

elif len(worstcase) == 0:
    print('best case')
    print(bestcase[0])  
    
elif len(bestcase) != 0 and  len(worstcase) != 0:
    print(worstcase[-1])
    print(bestcase[0])  

 
ZeroJudge Forum