mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
23 lines
419 B
C++
23 lines
419 B
C++
|
#include<cstdio>
|
||
|
#include<cstdio>
|
||
|
int main()
|
||
|
{
|
||
|
int n,sum,x,max,min;
|
||
|
while(scanf("%d",&n)!=EOF&&n!=0)
|
||
|
{
|
||
|
sum=0;
|
||
|
max=0,min=1000;
|
||
|
for(int i=0;i<n;i++)
|
||
|
{
|
||
|
scanf("%d",&x);
|
||
|
sum+=x;
|
||
|
if(x>max)max=x;
|
||
|
if(x<min)min=x;
|
||
|
}
|
||
|
sum-=max+min;
|
||
|
sum/=n-2;
|
||
|
printf("%d\n",sum);
|
||
|
}
|
||
|
return 0;
|
||
|
}
|