Create 1534.cpp

This commit is contained in:
KiritoTRw 2016-05-22 22:54:37 +08:00
parent 1a8ecb9d80
commit 7b46c3a5c3

30
QUSTOJ/1534.cpp Normal file
View File

@ -0,0 +1,30 @@
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
int n;
while(scanf("%d",&n)==1)
{
vector<double> vec;
double tmp;
for(int i=0;i<n;i++)
{
scanf("%lf",&tmp);
vec.push_back(tmp);
}
sort(vec.begin(),vec.end());
double sum=0;
for(int i=1;i<n-1;i++)
{
sum+=vec.at(i);
}
sum=sum/(n-2);
printf("%.2f\n",sum);
}
return 0;
}