void numave(double* res, int* num)
如果我没记错的话,实现的时候需要写上你的变量名,以及变量类型。
不写变量名的话就成了声明了把。。
其他的应该也是一样的把
#include
using namespace std;
#define M 4
#define N 5
char stu[N][10];
double res[M][N];
int num[M];
void numave(double res[][N],int num[])
{
int x,y;
double ave;
cout<<"每位同学的平均成绩";
for(x=0;x
ave=0.0;
for(y=0;y
ave=ave/5.0;
cout<
}
void stuave(double res[][N],char stu[][10])
{
int x,y;
double ave;
cout<<"每门课程的平均成绩";
for(y=0;y
ave=0.0;
for(x=0;x
ave=ave/4.0;
cout<
}
}
void search(double res[][N],char stu[][10],int num[])
{
int x,y,z;
double ave;
for(x=0;x
z=0;
ave=0.0;
for(y=0;y
ave+=res[x][y];
if(res[x][y]<60.0) z++;
}
if(z>2)
{
ave=ave/4.0;
cout<<"AAAA"<
}
}
void findmax(double res[][N],char stu[][10],int num[])
{
int x,y,a,b;
double max=0.0;
for(x=0;x
if(res[x][y]>max)
{max=res[x][y];a=x;b=y;}
}
cout<<"AA"<
void main()
{
int i,j;
cout<<"请输入对应的学号(空格隔开)"<
cout<<"请输入课程名(空格隔开)"<
cout<<"请输入对应的成绩(空格隔开)"<
numave(res,num);
stuave(res,stu);
search(res,stu,num);
findmax(res,stu,num);
}
void stuave(double*,char*)
少个大括号
local function definitions are illegal,意思是函数定义非法。你在函数中定义了函数