用我的改一下吧,可能能行,给你个参考吧~
#include
struct kecheng
{
int num2;
char name2[20];
double score;
};
struct student
{
char num[10];
char name[20];
kecheng lesson[5];
};
void sr(int a,student xs[]);
void sc1(int b,student xs[]);
void sc2(int c,student xs[]);
void main ()
{
student stu[4]={{"080901","Roy",01,"Wuli",0, 02,"English",0, 03,"Math",0, 04,"Sixiu",0, 05,"PE",0},
{"080902","Tom",01,"Wuli",0,02,"English",0,03,"Math",0,04,"Sixiu",0,05,"PE",0},
{"080903","Lucy",01,"Wuli",0,02,"English",0,03,"Math",0,04,"Sixiu",0,05,"PE",0},
{"080904","Lily",01,"Wuli",0,02,"English",0,03,"Math",0,04,"Sixiu",0,05,"PE",0}};
for(;;)
{
cout<<"欢迎使用本系统"<
cin>>m;
if(m==1)//成绩输入
{
cout<<"请选择您要输入的课程"<
cout< int m1;
cin>>m1;
sr(m1,stu);//函数调用
}
if(m==2)//成绩查询
{
cout<<"1.按学生查询成绩"<
cin>>m2;
if(m2==1)//按学生查询
{
cout<<"请选择您要查询的学生"<
cout< int n;
cin>>n;
sc1(n-1,stu);//函数调用
}
if(m2==2)//按课程查询
{
cout<<"请选择您要查询的课程"<
cout< int n;
cin>>n;
sc2(n-1,stu);//函数调用
}
}
if (m==0)
{
cout<<"谢谢您使用本系统"<
}
}
}
void sr(int a,student xs[])//输入成绩函数
{
for(int i=0;i<4;i++)
{
cout<
cout<
}
void sc1(int b,student xs[])//按学生查询函数
{
cout<<"查询"<
cout<
void sc2(int b,student xs[])//按课程信息查询函数
{
cout<<"查询"<
cout<
我靠之难度....
鬼才看得懂啊..
sssssssssssssssssssssssssssssssssss