求助,编译不通过,帮忙看看
#include<iostream>#include<string>
using namespace std;
class student
{public:
void putin(int,string,float,float,float);
void display();
void ave();
void sum();
int num;
string nam;
float math;
float english;
float chinese;
float summary;
float aver;};
void student::putin(int nu,string na,float m,float e,float c)
{num=nu;
nam=na;
math=m;
english=e;
chinese=c;}
void student::ave()
{aver=(math+english+chinese)/3;}
void student::sum()
{summary=math+english+chinese;}
void student::display()
{cout<<"学号:"<<num<<endl;
cout<<"姓名:"<<nam<<endl;
cout<<"数学成绩:"<<math<<endl;
cout<<"语文成绩:"<<chinese<<endl;
cout<<"英语成绩:"<<english<<endl;
cout<<"平均成绩:"<<aver<<endl;
cout<<"总成绩:"<<summary<<endl<<endl<<endl;
}
int main()
{student stu[10];
student *p;
int t=0; //判断输入个人数
p=&stu;
void next(student,student,int);
void revise(student,student,int); //修改
void count(student,student,int); //统计
void write(student); //写入
void tips(student,student,int); //提示
next(p,stu,t);
return 0;
}
void tips(student *a,student &b,int &c) //提示
{void next(student,student,int);
void revise(student,student,int); //修改
void count(student,student,int); //统计
int d;
cout<<"进行下一个输入请输入1,如果需要修改请按2,统计数据请按3"<<endl;
cout<<"请输入数字:";
cin>>d;
if(d=1)
next(a,b,c);
else if(d=2)
revise(a,b,c);
else if (d=3)
count(a,b,c);
else
{cout<<"输入错误,请重新输入";
tips(a,b,c);}
}
void write(student &z); //写入
{int u;
string a;
float b,c,d;
cout<<"学号:"
cin>>u;
cout<<ednl;
cout<<"姓名:";
cin>>a;
cout<<ednl;
cout<<"数学成绩:";
cin>>b;
cout<<ednl;
cout<<"语文成绩:";
cin>>c;
cout<<ednl;
cout<<"英语成绩:";
cin>>d;
cout<<ednl;
z.putin(u,a,b,c,d);
z.ave();
z.sum();
}
void next(student *x,student&b,int &c) //下一个
{void write(student );
write(x);
x++;
c++;
tips(x,b,c);
}
void revise(student &t,student &a,int &c) //修改功能
{void write(student);
int b;
student *r=&a;
cout<<"请输入需要要修改的学号:";
cin>>b;
for(int i=0;i<=c;i++,r++)
{if(r.num==b)
break;
else
{cout<<"学号输入有误,请重新输入:"<<endl;
revise(t,a,c);}
}
cout<<"请输入修改数据:";
write(r);
tips(t,a,c);
}
void count(student&a, student &s, int &z)
{student *p;
float e,c,m,q;
p=&s;
cout<<"您已输入"<<z<<"个学生的数据";
for(int i=0;i<=z;i++,p++)
{p.display();
e+=p.english;
c+=p.chinese;
m+=p.math;
q+=p.aver;}
cout<<"数学平均分:"<<m/z<<endl;
cout<<"英语平均分:"<<e/z<<endl;
cout<<"语文平均分:"<<c/z<<endl;
cout<<"总平均分:"<<q/z<<endl;
tips(a,s,z);
}