求助一道程序解答,谢谢大侠们!
#include <stdio.h>
void main( )
{
float average(float array[ ],int n);
float score_1[5]={98.5,97,91.5,60,55};
fioat score_2[10]={67.5,89.5,99,69.5,77,89.5,76.5,54,60,99.5};
printf ("the average of class A is %6.2\n", average(score_1,5));
printf ("the average of class B is %6.2\n", average(score_2,10));
}
float average (float array[ ],int n)
}
int i;
float aver, sum=array[ 0 ];
for(i=1; i<n; i++>
sum=sum+array[ i ];
aver=sum\n;
return(aver);
}
想问下大家,程序第16行 aver=sum\n;是什么意思啊 ?本人很菜也是新手,真的不知道什么意思?希望有知道的哥哥姐姐们教我一下,谢谢了啊!