OJ-Problems-Source/HDOJ/2014_autoAC.cpp
2016-08-19 16:52:35 +08:00

22 lines
447 B
C++

#include <stdio.h>
int main(void)
{
int n, i;
double min, max;
double x, y;
while (scanf("%d", &n) != EOF)
{
scanf("%lf", &x);
min = max = x;
for (i = 1 ; i < n ; i++)
{
scanf("%lf", &y);
x += y;
if (y > max) max = y;
if (y < min) min = y;
}
printf("%.2lf\n", (x - min - max) / (n - 2));
}
return 0;
}