其中,结构体类型定义的代码如下。 struct student { char name[20]; float score[3]; char address[20];
如下:
float total( struct student stu[],int nmb)
{
int i,j;
float sum=0,ave=0;
for (i=0;i<nmb;i++)
{
ave = 0;
for(j=0;j<3;j++)
ave + stu[i].score[j];
ave/=3.0;
sum += ave;
}
return sum/nmb;
}
您好,我是有问必答小助手,您的问题已经有小伙伴帮您解答,感谢您对有问必答的支持与关注!