Mrgteo79c @ 2023-01-30 19:38:07
#include<stdio.h>
int main()
{
int i,j,n;
double lev,tem,sum=0;
double a[10000];
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%lf ",&a[i]);
}
for(i=0;i<n;i++)
{
for(j=0;j<n-i-1;j++)
{
if(a[j]>a[j+1])
{
tem=a[j];
a[j]=a[j+1];
a[j+1]=tem;
}
}
}
for(i=0;i<n;i++)
{
sum+=a[i];
lev=(sum-a[0]-a[i])/(n-2);
}
printf("%.2lf",lev);
return 0;
}
by iterator_traits @ 2023-01-30 20:03:08
@Mrgteo79c 您可以把第二个scanf("%lf "
字符串里面的空格去掉就行了
by Mrgteo79c @ 2023-01-30 20:47:31
@iterator_traits 感谢