学生管理系统
#define_CRT_SECURE_NO_WARNINGS #include
voidAppendNode(longlong studentID,char studentName[10],char studentSex[4],int score[4]);//添加数据 voidDisplayNode(structlink*head);//显示数据
voidInsertNode(longlong studentID,char studentName[10],char studentSex[4],int score[4]);//插入一条数据;按总分的从大到小排序 voidInsertNodeNumber(longlong studentID,char studentName[10],char studentSex[4],int score[4]);//按学号的从小到大排序
voidNumberSorting(int flag);//按从大到小对数据进行排序;1、对总分进行排序,2、对学号进行排序 voidDeleteNodeID();//输入学号删除 voidDeleteNodeName();//输入学号删除
voidDeleteMemory(structlink*head);//删除聊表所占用的内存; voidSave();//保存数据 voidOpen();//打开数据
voidFindID();//按学号查找学生 voidFindName();//按姓名查找学生;
voidMenu();
typedefstructstudent {
longlongstudentID; charstudentName[10]; charstudentSex[4]; intscore[4];
}STU; structlink { };
structlink*head=NULL;//保存输入的学生信息数据 structlink*head1=NULL;//保存排序后的学生信息数据 intmain() {
longlongstudentID; charstudentName[10]; charstudentSex[4];
intscore[4];//定义要输入学生信息的变量; charc; STUstudent; structlink*next;
intmenu;//保存要进行的选项; Open(); while(1) {
system(\); Menu();
printf(\请输入要进行的操作:\); scanf(\,&menu); switch(menu) {
case0:exit(0);
break;
case1:
printf(\请输入Y或y来添加数据\\n\); scanf(\,&c); while(c=='y'||c=='Y') {
printf(\请输入学生学号:\); scanf(\,&studentID); printf(\请输入学生姓名:\); scanf(\,&studentName); printf(\请输入学生性别:\);
}
scanf(\,&studentSex); inti=0;
printf(\请分别输入学生四门课的成绩:\); for(i=0;i<4;i++) { }
AppendNode(studentID,studentName,studentSex,score); printf(\请输入Y或y来添加数据\\n\); scanf(\,&c);
scanf(\,&score[i]);
DisplayNode(head); break;
case2:
FindID(); break;
case3:
FindName(); break;
case4:
DeleteNodeID(); break;
}
}
case5:
DeleteNodeName();
case6:
NumberSorting(1); DeleteMemory(head1); head1=NULL; break;
case7:
NumberSorting(2); DeleteMemory(head1); head1=NULL; break;
default: }
printf(\输入有误!请重新输入\);
Save();
DeleteMemory(head); DeleteMemory(head1); system(\);
voidAppendNode(longlongstudentID,charstudentName[10],charstudentSe