資源描述:
《學(xué)生管理系統(tǒng)java代碼》由會員上傳分享,免費在線閱讀,更多相關(guān)內(nèi)容在學(xué)術(shù)論文-天天文庫。
1、#include#include#includetypedefstructStudent{longnumber;//學(xué)號charname[20];//姓名charClass[20];//班級charprofessional[20];//專業(yè)floatChinese;//語文floatEnglish;//英語floatMath;//數(shù)學(xué)floatChemical;//化學(xué)floatPhysical;//物理structStudent*next
2、;}student;//初始化student*Initstudent(student*head);//加入學(xué)生student*addstudent(student*head);//保存信息在外部文件voidsave(student*head);//打印所有成員voidprintfstudent(student*head);//查找學(xué)生voidFindstudent(student*head);//以名字查找student*name(student*head);//以學(xué)號查找student*num
3、ber(student*head);//刪除學(xué)生信息0Structstudent*del(structstudent*head);//修改學(xué)生信息correct(structstudent*head);//添加學(xué)生信息structstudent*insert(structstudent*head);//打印單個學(xué)生voidprint(student*head);//排序voidsort(student*head);//以名字排序student*Namesort(student*head);//以
4、學(xué)號排序student*Numbersort(student*head);//以班級排序student*Classsort(student*head);//以專業(yè)排序student*Professionsort(student*head);//以語文成績排序成績是從高到低排序student*Chinesesort(student*head);//以英語成績排序student*Englishsort(student*head);//以數(shù)學(xué)成績排序student*Mathsort(student*h
5、ead);//以物理成績排序student*physicalsort(student*head);//以化學(xué)成績排序student*Chemicalsort(student*head);#endifVoidmain(){charchoice;student*head=NULL,*q;q=Initstudent(head);do{printf("A--添加P--輸出B--保存C--刪除D--修改E—插入F--查找S--排序Q--退出");scanf("%c",&choice);choice=t
6、oupper(choice);switch(choice){case'A':q=addstudent(q);/*if())printf("添加成功!");elseprintf("添加失敗!");*/break;case'P':printfstudent(q);break;case’B’:save(q);break;case’C’:del(q);break;case’D’:correct(q);break;case’E’:insert(q);break;case'F':Findstuden
7、t(q);break;case'S':sort(q);break;case'Q':printf("再見!");break;default:printf("選擇錯誤!a");}}while(choice='Q');}structAchievement{intChinese;intEnglish;intMath;intChemical;intPhysical;}student*Initstudent(student*head){student;head=(student*)malloc(s
8、izeof(student));if(head==NULL){printf("預(yù)約空間失敗");exit(1);}head->next=NULL;head->length=0;returnhead;}student*addstudent(student*head){student*s,*p;intA,B,C,D,E;s=(student*)malloc(sizeof(student));//s->S=(Achievement*)malloc(sizeof(Achievement));二級指針