zjh202412904238 @ 2024-09-21 17:01:41
#include<stdio.h>
int main()
{
int n,max=11,min=-1,sum=0;
int a[1000];
scanf("%d",&n);
for(int i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
for(int i=0;i<n;i++)
{
sum+=a[i];
if(max<a[i])
max=a[i];
if(min>a[i])
min=a[i];
}
sum-=min;
sum-=max;
printf("%.2lf",(double)sum/(n-2));
return 0;
}
by FJ_00460 @ 2024-09-21 17:07:09
自己看
by Terrible @ 2024-09-21 17:14:16
@zjh202412904238
初值问题,改为:int n,max=-1,min=11,sum=0;
这居然能拿到 80 分,样例都不过,估计是一堆数据里总有 min+max
是