Merge pull request #14 from KiritoTRw/patch-1

Create 1534.cpp
This commit is contained in:
Kirigaya Kazuto 2016-05-22 22:55:04 +08:00
commit 94c5a1e461

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;
}