資源描述:
《用C語(yǔ)言寫(xiě)的學(xué)生信息管理系統(tǒng)+自己寫(xiě)的.doc》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在應(yīng)用文檔-天天文庫(kù)。
1、#include#includestructstudent{intnum;charname[20];inty;ints;intd;intz;intbz;};structstudentstu[1000];intn=0;voidred();voidf1();voidf2();voidf3();voidf4();voidsav();voidmain(){FILE*fp;????if((fp=fopen("student","r"))==NULL){????????
2、fclose(fp);??FILE*fp;??fp=fopen("student","w");??fclose(fp);}????red();????inti;loop1:??printf("************************************************??1??查詢每科最高分的學(xué)生??2??查詢所有學(xué)生??3??刪除信息??4??添加信息其它??退出保存******************************************
3、******");????scanf("%d",&i);????switch(i){????????????case1:????f1();????goto??loop1;??????????????????????????case2:????f2();????goto??loop1;????????sav();??case3:????f3();????goto??loop1;??case4:??????f4();??????goto??loop1;????default:????sav();
4、??}printf("操作已保存");}voidred(){inti;FILE*fp;fp=fopen("student","r");for(i=0;!feof(fp);i++){??fread(&stu[i],sizeof(structstudent),1,fp);??n=i+1;}fclose(fp);}voidf1(){????inti;????printf("************************************************1語(yǔ)文2數(shù)學(xué)3代數(shù)
5、************************************************");????scanf("%d",&i);????switch(i){????case1:??{????????????intj;????????????structstudentst;????????st.y=0;????????????for(j=0;jst.y)st=stu[j]
6、;????printf("語(yǔ)文最高分的學(xué)生:");????if(stu[i].bz)????{????????????????printf("????學(xué)號(hào)????姓名??????語(yǔ)文????數(shù)學(xué)????代數(shù)????總分");????????????printf("%8d%10s%8d%8d%8d%8d",st.num,st.name,st.y,st.s,st.d,st.z);????}??????break;??}????case2:??{????????intj;????????s
7、tructstudentst;????st.s=0;????????for(j=0;jst.s)st=stu[j];??printf("數(shù)學(xué)最高分的學(xué)生:");????????if(stu[i].bz)????{????????????????printf("????學(xué)號(hào)????姓名??????語(yǔ)文????數(shù)學(xué)????代數(shù)????總分");????????????printf("%8d%10s
8、%8d%8d%8d%8d",st.num,st.name,st.y,st.s,st.d,st.z);????}????????break;??}????case3:??{??????????intj;??????????structstudentst;??????st.d=0;??????????for(j=0;jst.d)st=stu[j];??printf("代數(shù)最高分的學(xué)生: