} else if(b==2) {cout<<\请输入新节次\ cin>>jieci; st1[i].setjieci(jieci); } else if(b==3) {cout<<\请输入新课程名称\ cin>>kechen; st1[i].setkechen(kechen); }
else if(b==4) { cout<<\请输入新缺课类型\ cin>>queke; st1[i].setqklx(queke); } flgh=1;j++; }while(b<1||b>4); if(flgh==0) {cout<<\没有你要找的学生姓名,请重试要退出请按0\ cin>>k; } else {cout<<\还要继续吗(1\\0)退出请按0\ cin>>k; } }
for(int i=0;i // 查询函数 void chaxun(xinxi st1[],qstu qt[]) { char n='y'; int u[10]; while(n=='y') { int j=0; cout<<\输入你要查询的学生姓名:\ cin>>name; int i=0; for(;i if(strcmp(name,st1[i].getname())==0) { u[j]=i; j++; } if(j==0) { cout<<\没有你所要的学生名字!\没有找到 cout<<\是否退出退出请按n\\n\ cin>>n; } for(int a=0;a cout<<\缺课日期 |\第几节课 |\课程名称 |\缺课类型 |\ cout<<\\\ \ < i=u[a]; if(*(st1[i].gettime()+1)<*(st1[i+1].gettime()+1)) qt[i].print(st1[i]); else if(*(st1[i].gettime()+1)==*(st1[i+1].gettime()+1)&&*(st1[i].gettime()+2)<*(st1[i+1].gettime()+2)) qt[i].print(st1[i]); else if(*(st1[i].gettime()+1)==*(st1[i+1].gettime()+1)&&*(st1[i].gettime()+2)==*(st1[i+1].gettime()+2)) if(strcmp(st1[i].getjieci(),st1[i+1].getjieci())==-1) qt[i].print(st1[i]); } cout<<\是否继续查询(y/n)继续请按y退出按n\ cin>>n; } } } //统计某段时间内旷课学生姓名及旷课节数 void tongji1(xinxi st1[],qstu qt1[]) { int d1=0,js=0; xinxi min; if(g==0) cout<<\没有你要统计的学生信息请返回菜单录入学生缺课信息\ else if(g==1) { cout<<\姓名:\ if(*(st1[0].getjieci()+2)!='\\0') js=+2; else js++; cout<<\节数:\ } else //信息按时间排序 {int i=0; for(;i<(g-1);i++) { if(*(st1[i].gettime()+1)<*(st1[i+1].gettime()+1)) {min=st1[i];st1[i]=st1[i+1];st1[i+1]=st1[i];} else if(*(st1[i].gettime()+1)==*(st1[i+1].gettime()+1)&&*(st1[i].gettime()+2)<*(st1[i+1].gettime()+2)) {min=st1[i];st1[i]=st1[i+1];st1[i+1]=st1[i];} else if(*(st1[i].gettime()+1)==*(st1[i+1].gettime()+1)&&*(st1[i].gettime()+2)==*(st1[i+1].gettime()+2)) d1++; } for(int j=0;j<(g-d1);j++) { cout<<*st1[j].gettime()<<*(st1[j].gettime()+1)<<*(st1[j].gettime()+2)< //统计某段时间内旷课的课程及旷课人次 void tongji2(xinxi st1[],qkechen qk1[]) { int d1=0,rc=0; xinxi min; if(g==0) cout<<\没有你要统计的学生信息请返回菜单录入学生缺课信息\ else if(g==1) { cout<<\课程名:\ rc++; cout<<\人数:\ } else { int i=0; for(;i if(*(st1[i].gettime()+1)==*(st1[i+1].gettime()+1)&&*(st1[i].gettime()+2)<*(st1[i+1].gettime()+2)) {min=st1[i];st1[i]=st1[i+1];st1[i+1]=st1[i];} else if(*(st1[i].gettime()+1)==*(st1[i+1].gettime()+1)&&*(st1[i].gettime()+2)==*(st1[i+1].gettime()+2)) d1++; } for(int j=0;j<(g-d1);j++) { cout<<*st1[j].gettime()<<*(st1[j].gettime()+1)<<*(st1[j].gettime()+2)< //显示函数 void xiansi(xinxi &st1) { cout<<\缺课日期 |\第几节课 |\课程名称 |\学生姓名|\缺课类型|\ cout<<\ <<\ //设置缺课学生名 void setqstn(xinxi st1[],qstu qt1[],int n) { int i=0; for(;i strcpy(qt1[0].qstn,st1[i].getname()); else if(strcmp(st1[i].getname(),st1[i+1].getname())!=0) {strcpy(qt1[i].qstn,st1[i].getname()); k++; } } } //设置有缺课学生的课程名 void setqkn(xinxi st1[],qkechen qk[],int n) { int i=0; for(;i strcpy(qk[0].qkn,st1[i].getkechen()); else if(strcmp(st1[i].getkechen(),st1[i+1].getkechen())!=0) {strcpy(qk[i].qkn,st1[i+1].getkechen()); b++; } } }