#include <stdio.h>
main( )
{
int a[5]={20,30,45,64,23};
float m;
/**/ /**/
m=average(a, 5 );
printf(“Average=%f\n”,m);
getch();
}
float average(int pa[] ,int n)
{ int k;
float avg=0.0;
for(k=0;k<n;k++)
avg=avg+/**/ /**/;
avg= avg/n;
return avg;
}
/*计算数组元素的平均值*/
>> 本文固定链接: http://www.vcgood.com/archives/2430