怎么求均方差?还有没有换一种的方式写出来,求大神
#include <stdio.h>void main()
{
int a[15]={355,345,365,343,354,367,383,521,120,354,345,367,356,348,350};
int i,max,min,sum;
double average;
sum=0;
max=a[0];
min=a[0];
for(i=0;i<15;i++)
{
if(max<a[i])
max=a[i];
if(min>a[i])
min=a[i];
sum=sum+a[i];
}
average=(double)(sum-max-min)/3;
printf("\nThe max=%d\n",max);
printf("\nThe min=%d\n",min);
printf("\nThe average is:%f\n",average);
printf("\n");
}