2.21.2 评委评分

来源:互联网 发布:游戏中用得最多的算法 编辑:程序博客网 时间:2024/05/22 05:28


#include <bits/stdc++.h>
using namespace std;
#define m 100
int b[m];
int main()
{
    int a;
    while(cin>>a)
    {
        int i,s=0;
        for(i=0;i<a;i++)
        {
            cin>>b[i];
        }
        sort(b,b+a);
        for(i=1;i<a-1;i++)
        {
            s+=b[i];
        }
        float n=(float)s/(a-2);
        cout<<setprecision(2)<<std::fixed<<n<<endl;
    }
    return 0;
}

0 0