试题编号: 201903-1
试题名称: 小中大
时间限制: 1.0s
内存限制: 512.0MB
问题描述:
TOTAL=int(input())
L=list(map(int,input().split()))
MIN=L[0]
MAX=L[0]
SUM=0
for x in L:
if x<MIN:
MIN=x
if x>MAX:
MAX=x
L.sort()
if len(L)%2==1:
MID=L[len(L)//2]
if len(L)%2==0:
MID=(L[len(L)//2]+L[(len(L)//2)-1])/2
if int(MID)!=MID:
MID=round(MID,1)
else:
MID=round(MID)
OUT=[MIN,MAX,MID]
OUT.sort(reverse=True)
PRINT=''+str(OUT[0])+" "+str(OUT[1])+" "+str(OUT[2])
print(PRINT)