某学生的记录由学号、8门课程成绩和平均分组成,学号和8门课程的成绩已在主函数中给出,请编写函数fun,其功能是:求出该学生的平均分,并放入记录的ave成员中。
注意:部分源程序给出如下。
请勿改动主函数main和其他函数中的任何内容,仅在函数fun部位中填入你编写的若干语句。
试题程序:
#include <stdio .h>
#define N 8
typedef struct
char num[10];
double s[N];
double ave;
STREC;
void fun (STREC * a)
void main ()
STREC s= "GA005", 85.5, 76, 69.5, 85, 91, 72, 64.5, 87.5;
int i;
fun(&s);
printf("The % s’s student data:\n",
s.num);
printf("% 4.1f\n", s.s[i]);
printf "\nave=% 7.3f\n", s.
ave);