BC93 公务员面试

思路:

step1:输入一组数,求出筛选后的均值,格式化输出;

代码如下:

while True:
    try:
        n = input().split()
        n1 = list(map(int,n))
        m = 0
        for i in n1:
            m += i
        ave = (m - max(n1) - min(n1)) / (len(n) - 2) + 0.000001
        print('{:.2f}'.format(ave))
    except:
        break