{
cout<<\所查信息不存在!\ cout<<\请重新输入\ goto l4; }
goto l1; } if(m==4) {
caidan(ST); } }
void paixu(SqList &ST) //排序 {
l1: int n;
cout<
cout<<\根据学号排序\ cout<<\根据成绩1排序\
cout<<\根据成绩2排序\ cout<<\根据总成绩排序\ cout<<\退出\ cout<
if(n==1) //按学号排序,使用插入排序 {
RecordType LI; //定义存储学号向量 for(int i=1;i
if(ST.r[j].xuehao
LI=ST.r[j];
ST.r[j]=ST.r[j-1]; ST.r[j-1]=LI;
}
shuchu(ST);
cout<<\排序完毕\ goto l1; }
if(n==2) //按成绩1排序,用选择排序 {
RecordType LI;
for(int i=0; i
for (int j=i+1;j
if(ST.r[i].chengji1>ST.r[j].chengji1) {
LI=ST.r[j];
ST.r[j]=ST.r[i]; ST.r[i]=LI; } } shuchu(ST);
cout<<\排序完毕\ goto l1; }
if(n==3) // 根据成绩2排序,使用选择法排序 {
RecordType LI;
for(int i=0; i
for (int j=i+1;j
if(ST.r[i].chengji2>ST.r[j].chengji2) {
LI=ST.r[j];
ST.r[j]=ST.r[i]; ST.r[i]=LI; } } shuchu(ST);
cout<<\排序完毕\
goto l1; }
if(n==4) //根据总成绩排序,使用选择法排序 {
RecordType LI;
for(int i=0; i
for (int j=i+1;j
if(ST.r[i].zong>ST.r[j].zong) {
LI=ST.r[j];
ST.r[j]=ST.r[i]; ST.r[i]=LI; } } shuchu(ST);
cout<<\排序完毕\ goto l1; }
if(n==5) //退出 {
caidan(ST); } }
void caidan(SqList &ST)//选择菜单 {
cout<<\请选择要进入的模块\ cout<<\查询\ cout<<\排序\ cout<<\退出\ int c; cin>>c; if(c==1) {
chaxun(ST);
}
if(c==2) {
paixu(ST); }
if(c==3) {
exit(0); } }
void main() {
SqList ST; CreatList(ST); zong(ST); shuchu(ST); caidan(ST); }