【问题描述】输入若干成绩值,以回车作为输入结束。输出最高的三个成绩值,以及最大值和最小值。
【输入 形式】"Input a score(end of enter):"
【输出形式】“Top 3 scores:”
"max=,min="
【有帮助请采纳】
numlist = list(map(''.join,sorted(input('Input a score(end of enter):').split())))
print('Top 3 scores:%g %g %g'%(numlist[-1],numlist[-2],numlist[-3]))
print('max=%g,min=%g'%(max(numlist),min(numlist)))
【有帮助请采纳】