average函数的功能是计算成绩数组中的平均成绩,并将平均成绩返回。
```c
#include <stdio.h>
double average (int n, int *score) {
double sum=0;
for(;score<score+n-1;score++) sum+=*score;
return sum/n;
}
int main () {
int n = 10, score[10] = {88, 99, 76, 78, 89, 93, 95, 86, 92, 85};
double ave_score;
ave_score = average(n, score);
printf("%f\n", ave_score);
return 0;
}
```