编写一个函数,int fun(int score[],int m,int below[])
如题编写一个int fun(int score[],int m,int below[])函数,score[]用来存放成绩,m代表学生人数,below[]用来存放低于平均分的成绩。#include<stdio.h>
int main()
{
int fun(int score[],int m,int below[]);
int i,m,score[m],aver;
printf("intput m:\n");
scanf("%d",&m);
printf("intput scores:\n");
for(i=0;i<m;i++)
scanf("%d",&score[i]);
aver=fun(score,m,below);
fun(score,m,below);
for(i=0;i<m;i++)
printf("%d",below[i]);
}
int fun(int score[],int m,int below[])
{
int sum=score[0],i,j=0,aver;
for(i=1;i<m;i++)
sum=sum+score[i];
aver=sum/m;
for(i=0;i<m;i++)
if(score[i]<aver)
below[j++]=score[i];
return aver;
}
error: `below' was not declared in this scope
warning: no newline at end of file
有好多错误但不知道要怎样改