帮忙看看这个错误怎样解决
#include <iostream>#include <string>
#include <iomanip>
using namespace std;
int b=0;
struct student
{
string num;
string name;
string kind;
string cl1;
string cl2;
};
student stu[3];
struct course
{
string num;
string name;
string kind;
string credit;
string totaltime;
string sk;
string xx;
};
course kk[10];
void mainmeun();
void input();
void 1mainmeun();
void 2mainmeun();
void findxz();
void findxf();
void output();
int main()
{
kk[0].num="1001";
kk[0].name="思想道德修养与法律基础";
kk[0].kind="公共课";
kk[0].credit=15;
kk[0].totaltime=18;
kk[0].sk=18;
kk[0].xx="按时上课";
kk[1].num="1002";
kk[1].name="大学生体育";
kk[1].kind="公共课";
kk[1].credit=10;
kk[1].totaltime=18;
kk[1].sk=18;
kk[1].xx="按时上课";
kk[2].num="1003";
kk[2].name="高等数学";
kk[2].kind="公共课";
kk[2].credit=15;
kk[2].totaltime=18;
kk[2].sk=18;
kk[2].xx="按时上课";
kk[3].num="1004";
kk[3].name="计算机电路";
kk[3].kind="必修课";
kk[3].credit=15;
kk[3].totaltime=18;
kk[3].sk=18;
kk[3].xx="按时上课";
kk[4].num="1005";
kk[4].name="计算机概论";
kk[4].kind="必修课";
kk[4].credit=15;
kk[4].totaltime=18;
kk[4].sk=18;
kk[4].xx="按时上课";
kk[4].num="1006";
kk[5].name="大学英语";
kk[5].kind="公共课";
kk[5].credit=15;
kk[5].totaltime=18;
kk[5].sk=18;
kk[5].xx="按时上课";
kk[4].num="1007";
kk[6].name="程序设计基础";
kk[6].kind="必修课";
kk[6].credit=15;
kk[6].totaltime=18;
kk[6].sk=18;
kk[6].xx="按时上课";
kk[4].num="1008";
kk[7].name="大学生安全教育";
kk[7].kind="公共课";
kk[7].credit=15;
kk[7].totaltime=18;
kk[7].sk=18;
kk[7].xx="按时上课";
kk[4].num="1009";
kk[8].name="国防教育";
kk[8].kind="公共课";
kk[8].credit=10;
kk[8].totaltime=18;
kk[8].sk=18;
kk[8].xx="按时上课";
kk[4].num="1010";
kk[9].name="形势与政策";
kk[9].kind="公共课";
kk[9].credit=10;
kk[9].totaltime=18;
kk[9].sk=18;
kk[9].xx="按时上课";
mainmeun();
while(1)
{
int x;
cout<<"请选择菜单(0---6)"<<endl;
cin>>x;
switch(x)
{
case 1:switch(1mainmeun())
{
case 1:input();break;
case 2:output();break;
}break;
case 2:input();break;
case 3:
case 4:switch(2mainmeun())
{
case 1:findxz();break;
case 2:findxf();break;
}break;
case 0:exit(0);
}
}
return 0;
}
void mainmeun()//菜单函数
{
cout<<"≈≈≈≈≈≈≈≈≈≈≈≈≈≈"<<endl;
cout<<"‖****欢迎来到选课系统****‖"<<endl;
cout<<"‖1-----------输入学生信息‖"<<endl;
cout<<"‖2-----------添加选修科目‖"<<endl;
cout<<"‖3-----------删除已选科目‖"<<endl;
cout<<"‖4---------------分类查询‖"<<endl;
cout<<"‖0-----------退出选课程序‖"<<endl;
cout<<"≈≈≈≈≈≈≈≈≈≈≈≈≈≈"<<endl;
}
void 1mainmeun()
{
cout<<"≈≈≈≈≈≈≈≈≈≈≈≈≈≈"<<endl;
cout<<"‖1-----------输入学生信息‖"<<endl;
cout<<"‖2-----------查看学生信息‖"<<endl;
cout<<"‖0-------------返回主菜单‖"<<endl;
cout<<"≈≈≈≈≈≈≈≈≈≈≈≈≈≈"<<endl;
}
void 2mainmeun()
{
cout<<"≈≈≈≈≈≈≈≈≈≈≈≈≈≈"<<endl;
cout<<"‖1---------按课程性质查询‖"<<endl;
cout<<"‖2-------------安学分查询‖"<<endl;
cout<<"‖0-------------返回主菜单‖"<<endl;
cout<<"≈≈≈≈≈≈≈≈≈≈≈≈≈≈"<<endl;
void input()//输入函数
{
int c=0;
char s;
while(s!='n'&&b<15)
{
cout<<"学生学号:";
cin>>kk[c].num;
cout<<"姓名:";
cin>>kk[c].name;
cout<<"专业:";
cin>>kk[c].kind;
b++;
cout<<"是否继续输入?(Y/N):";
cin>>s;
}
}
void output ()//输出学生信息
{
cout<<" ---------------------------------------------- "<<endl;
cout<<" "<<"学生学号"<<" "<<"姓名"<<" "<<"专业"<<" "<<endl;
cout<<" ---------------------------------------------- "<<endl;
for(int c=0;c<b;c++)
cout<<" "<<stu[c].num<<" "<<stu[c].name<<" "<<stu[c].kind<<endl;
}
void findxz()//按性质查询
{
string j0;
cout<<"请输入要查询的性质";
cin>>j0;
for(int j1=0;j1<=b;j1++)
if(j0==stu[j1].name)
{ cout<<stu[j1].num<<stu[j1].name;
for(int j2=0;j2<6;j2++)
if(kk[j2].num==stu[j1].cl1)
cout<<kk[j2].name;
for(int j3=0;j3<6;j3++)
if(kk[j3].num==stu[j1].cl2)
cout<<kk[j3].name;
}
}
void findxf()//按学分查询
{
string j0;
cout<<"请输入要查询的学号";
cin>>j0;
for(int j1=0;j1<=b;j1++)
if(j0==kk[j1].credit)
{ cout<<kk[j1].credit<<kk[j1].name;
for(int j2=0;j2<6;j2++)
if(kk[j2].credit==stu[j1].cl1)
cout<<stu[j2].name;
for(int j3=0;j3<6;j3++)
if(kk[j3].credit==stu[j1].cl2)
cout<<kk[j3].name;
}
}
错误内容是:C:\Windows\System32\8.cpp(29) : error C2059: syntax error : 'bad suffix on number'
C:\Windows\System32\8.cpp(29) : warning C4091: '' : ignored on left of 'void' when no variable is declared
C:\Windows\System32\8.cpp(29) : error C2143: syntax error : missing ';' before 'constant'
C:\Windows\System32\8.cpp(29) : fatal error C1004: unexpected end of file found
执行 cl.exe 时出错.
8.obj - 1 error(s), 0 warning(s)