![學生成績管理C語言_第1頁](http://file3.renrendoc.com/fileroot_temp3/2022-2/2/12871f01-9bab-46aa-860f-e59010573537/12871f01-9bab-46aa-860f-e590105735371.gif)
![學生成績管理C語言_第2頁](http://file3.renrendoc.com/fileroot_temp3/2022-2/2/12871f01-9bab-46aa-860f-e59010573537/12871f01-9bab-46aa-860f-e590105735372.gif)
![學生成績管理C語言_第3頁](http://file3.renrendoc.com/fileroot_temp3/2022-2/2/12871f01-9bab-46aa-860f-e59010573537/12871f01-9bab-46aa-860f-e590105735373.gif)
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
1、演講稿工作總結(jié)調(diào)研報告講話稿事跡材料心得體會策劃方案學生成績管理 C 語言#include <stdio.h>#define N 2struct studentint xh;float score4;char name20;float average;int num;std100;int n=0;/* 學生總?cè)藬?shù) */*輸入學生數(shù)據(jù) */void srsj() FILE *fp; fp=fopen("lishengjie.txt","w");int i,j;for(i=0;i<N;i+)printf(" 請輸入第 %d 個學生
2、的信息: n",i+1);printf(" 請輸入學生學號 :n");精心收集精心編輯精致閱讀如需請下載!演講稿工作總結(jié)調(diào)研報告講話稿事跡材料心得體會策劃方案scanf("%d",&stdi.xh);for(j=0;j<i;j+)if(stdi.xh=stdj.xh)printf(" 學生學號重復(fù),請重新輸入n");printf(" 請輸入學生學號 :n");scanf("%d",&stdi.xh);printf(" 請輸入學生姓名 :n");
3、scanf("%s",&);printf(" 請輸入學生 c 程序設(shè)計成績 :n");scanf("%f",&stdi.score0);printf(" 請輸入學生高數(shù)成績 :n");scanf("%f",&stdi.score1);printf(" 請輸入學生英語成績 :n");scanf("%f",&stdi.score2);printf(" 請輸入學生線代成績 :n");scanf
4、("%f",&stdi.score3);n+;fprintf(fp,"n%dn%snc程序設(shè)計成績 :%.2fn 高數(shù)成績 :%.2fn 英語成績 :%.2fn 線代成績 :%.2fn",stdi.xh,,stdi.score0,stdi.score1,stdi.score2,stdi.score3);精心收集精心編輯精致閱讀如需請下載!演講稿工作總結(jié)調(diào)研報告講話稿事跡材料心得體會策劃方案fprintf(fp,"%d",n);fclose(fp);/* 計算單個同學的平均分 */void average(in
5、t i) float sum;sum=stdi.score0+stdi.score1+stdi.score2+stdi.score3;stdi.average=sum/4;/* 計算每位同學的平均分 */void pjf1() int i,m; float sum; for(i=0;i<n;i+)精心收集精心編輯精致閱讀如需請下載!演講稿工作總結(jié)調(diào)研報告講話稿事跡材料心得體會策劃方案 sum=stdi.score0+stdi.score1+stdi.score2+stdi.score3;stdi.average=sum/4;for(m=0;m<n;m+)printf("%
6、s 的平均分為 :%.2fn",,stdm.average);/* 計算各科成績的平均分 */void pjf2() int m;float i=0.0,j=0.0,k=0.0,l=0.0;float average4;for(m=0;m<n;m+) i=i+stdm.score0; j=j+stdm.score1; k=k+stdm.score2;l=l+stdm.score3;average0=i/n;average1=j/n;average2=k/n;average3=l/n;精心收集精心編輯精致閱讀如需請下載!演講稿工作總結(jié)調(diào)研報告講話稿事跡材料心得體
7、會策劃方案printf("C 語言高數(shù)英語線代各科成績平均分為:n");printf("%.2f%.2f%.2f%.2f",average0,average1,average2,average3);/* 統(tǒng)計各分段人數(shù) */void tj() int i;int a4=0,0,0,0;/*C 語言 */int b4=0,0,0,0;/* 高數(shù) */int c4=0,0,0,0;/* 英語 */int d4=0,0,0,0;/* 線代 */int e4=0,0,0,0;/* 平均分 */for(i=0;i<n;i+)if(stdi.score0>
8、;=90)a0+;elseif(stdi.score0>=80&&stdi.score0<=89)a1+;elseif(stdi.score0>=60&&stdi.score0<=79)a2+;精心收集精心編輯精致閱讀如需請下載!演講稿工作總結(jié)調(diào)研報告講話稿事跡材料心得體會策劃方案elsea3+;if(stdi.score1>=90)b0+;elseif(stdi.score1>=80&&stdi.score1<=89)b1+;elseif(stdi.score1>=60&&stdi
9、.score1<=79)b2+;elseb3+;if(stdi.score2>=90)c0+;elseif(stdi.score2>=80&&stdi.score2<=89)c1+;elseif(stdi.score2>=60&&stdi.score2<=79)c2+;elsec3+;精心收集精心編輯精致閱讀如需請下載!演講稿工作總結(jié)調(diào)研報告講話稿事跡材料心得體會策劃方案if(stdi.score3>=90)d0+;elseif(stdi.score3>=80&&stdi.score3<=89
10、)d1+;elseif(stdi.score3>=60&&stdi.score3<=79)d2+;elsed3+;if(stdi.average>=90)e0+;elseif(stdi.average>=80&&stdi.average<=89)e1+;elseif(stdi.average>=60&&stdi.average<=79)e2+;elsee3+;printf("C 語言高數(shù)英語線代平均分 n");精心收集精心編輯精致閱讀如需請下載!演講稿工作總結(jié)調(diào)研報告講話稿事跡材料心得
11、體會策劃方案printf("90-100:%d%d%d%d%dn",a0,b0,c0,d0,e0);printf("80-89:%d%d%d%d%dn",a1,b1,c1,d1,e1);printf("60-79:%d%d%d%d%dn",a2,b2,c2,d2,e2);printf("60 以下 :%d%d%d%d%dn",a3,b3,c3,d3,e3);/* 按各個同學平均分排序,給出名次*/void px()int m,i,j,t=1;for(i=0;i<n;i+,t=1)for(j=0;j<n;
12、j+)if(stdi.average<stdj.average)t+;stdi.num=t;精心收集精心編輯精致閱讀如需請下載!演講稿工作總結(jié)調(diào)研報告講話稿事跡材料心得體會策劃方案printf(" 學號 姓名 平均分名次 n");for(m=0;m<n;m+)printf(" %d%s%.2f%dn",stdm.xh,,stdm.average,stdm.num);/* 通過學號返回數(shù)組下標 */int search(int xh)int i;for (i=0;i<=n;i+) if (stdi.xh=xh)retur
13、n i;return -1;/* 顯示單個學生信息 */精心收集精心編輯精致閱讀如需請下載!演講稿工作總結(jié)調(diào)研報告講話稿事跡材料心得體會策劃方案void xx(int p)printf(" 學號 姓名 C 語言 高數(shù) 英語線代平均分 n");printf(" %d %s %.2f %.2f %.2f %.2f %.2f",stdp.xh,stdp.na me,stdp.score0,stdp.score1,stdp.score2,stdp.score3,stdp.average);/* 增加數(shù)據(jù) */void increase() doprintf(&q
14、uot; 請輸入學生學號 :n");scanf("%d",&stdn.xh);printf(" 請輸入學生姓名 :n");scanf("%s",&);printf(" 請輸入學生 c 程序設(shè)計成績 :n");scanf("%f",&stdn.score0);printf(" 請輸入學生高數(shù)成績 :n");精心收集精心編輯精致閱讀如需請下載!演講稿工作總結(jié)調(diào)研報告講話稿事跡材料心得體會策劃方案scanf("%f&qu
15、ot;,&stdn.score1);printf(" 請輸入學生英語成績 :n");scanf("%f",&stdn.score2);printf(" 請輸入學生線代成績 :n");scanf("%f",&stdn.score3);average(n);n+;printf("n 是否繼續(xù)輸入 ?(y/n)n");getchar();while(getchar()='y');/* 刪除數(shù)據(jù) */void Delete() int p,i,xh; while(
16、1)printf(" 請輸入要刪除的學生的學號:");scanf("%d",&xh);p=search(xh);if(p=-1)精心收集精心編輯精致閱讀如需請下載!演講稿工作總結(jié)調(diào)研報告講話稿事跡材料心得體會策劃方案printf(" 您所查找的學生不存在 ");else printf(" 要刪除的學生信息為 :n"); xx(p);printf("n 是否刪除 ?(y/n)");getchar();if(getchar()='y') for(i=p;i<n;i+)
17、stdi=stdi+1;n-;printf("n 是否繼續(xù) ?(y/n)n");getchar();if(getchar()='n')break;/* 修改數(shù)據(jù) */void repair()精心收集精心編輯精致閱讀如需請下載!演講稿工作總結(jié)調(diào)研報告講話稿事跡材料心得體會策劃方案 int xh,p;while(1) printf(" 請輸入要修改的學生的學號 :"); scanf("%d",&xh);p=search(xh); if(p=-1)printf(" 您所查找的學生不存在 ");
18、else printf(" 要修改的學生信息為 :n"); xx(p);printf("n 是否修改 ?(y/n)");getchar();if(getchar()='y')printf("- 請輸入新數(shù)據(jù) -n");printf(" 請輸入學生學號 :n");scanf("%d",&stdp.xh);printf(" 請輸入學生姓名 :n");scanf("%s",&);printf(" 請輸入
19、學生 c 程序設(shè)計成績 :n");scanf("%f",&stdp.score0);printf(" 請輸入學生高數(shù)成績 :n");scanf("%f",&stdp.score1);精心收集精心編輯精致閱讀如需請下載!演講稿工作總結(jié)調(diào)研報告講話稿事跡材料心得體會策劃方案printf(" 請輸入學生英語成績 :n");scanf("%f",&stdp.score2);printf(" 請輸入學生線代成績 :n");scanf("%f&
20、quot;,&stdp.score3);average(p);printf("n 是否繼續(xù) ?(y/n)n");getchar();if(getchar()='n')break;/* 按學號進行查詢 */void inquire() int xh,p; while(1) printf(" 請輸入要查詢的學生的學號 :"); scanf("%d",&xh);精心收集精心編輯精致閱讀如需請下載!演講稿工作總結(jié)調(diào)研報告講話稿事跡材料心得體會策劃方案p=search(xh);if(p=-1)printf(&qu
21、ot; 所查詢的學生不存在 n");elseprintf(" 所查詢的學生信息為 :n");xx(p);printf("n 是否繼續(xù) ?(y/n)n");getchar();if(getchar()='n')break;/* 輸出結(jié)果 */void out() FILE *fp; int p,t;fp=fopen("lishengjie.txt","r");for(t=0;t<n;t+) fscanf(fp,"%d%s%.2f%.2f%.2f%.2fn",&
22、;stdt.xh,&,&stdt.sc精心收集精心編輯精致閱讀如需請下載!演講稿工作總結(jié)調(diào)研報告講話稿事跡材料心得體會策劃方案ore0,&stdt.score1,&stdt.score2,&stdt.score3);printf(" 學號姓名C語言設(shè)計高等數(shù)學英語線性代數(shù)平均分名次n");for(p=0;p<2;p+)printf(" %d%s%.2f%.2f%.2f%.2f%.2f%dn",stdp.xh,,stdp.score0,stdp.score1,stdp.score2,stdp.score3,stdp.average,stdp.num);pjf2();printf("n");tj();fclose(fp);精心收集精心編輯精致閱讀如需請下載!演講稿工作總結(jié)調(diào)研報告講話稿事跡材料心得體會策劃方案/* 菜單 */void main() int gongneng; while(1)printf("n=歡迎進入學生管理系統(tǒng)=n");printf("1. 輸入學生數(shù)據(jù) n");printf(&quo
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 26《好的故事》說課稿-2024-2025學年語文六年級上冊統(tǒng)編版
- 1場景歌說課稿-2024-2025學年統(tǒng)編版語文二年級上冊
- 2024年秋一年級道德與法治下冊 第二單元 我和大自然 5 風兒輕輕吹說課稿 新人教版
- 18古詩三首浪淘沙(其一)說課稿-2024-2025學年六年級上冊語文統(tǒng)編版
- 8 設(shè)計制作小車(二) 說課稿-2024-2025學年科學四年級上冊教科版
- 23《月光曲》說課稿-2024-2025學年語文六年級上冊統(tǒng)編版
- 1 24時計時法(說課稿)-2024-2025學年三年級上冊數(shù)學人教版001
- 2023九年級道德與法治上冊 第三單元 文明與家園 第五課 守望精神家園第2框 凝聚價值追求說課稿 新人教版
- 2025北京市飼料采購合同新
- 2025建造船舶所要用到的合同
- 中醫(yī)中風病(腦梗死)診療方案
- GMP-基礎(chǔ)知識培訓(xùn)
- 人教版小學六年級數(shù)學下冊(全冊)教案
- 人教版二年級語文上冊同音字歸類
- 高二數(shù)學下學期教學計劃
- 文學類作品閱讀練習-2023年中考語文考前專項練習(浙江紹興)(含解析)
- SB/T 10624-2011洗染業(yè)服務(wù)經(jīng)營規(guī)范
- 第五章硅酸鹽分析
- 外科學總論-第十四章腫瘤
- 網(wǎng)絡(luò)反詐知識競賽參考題庫100題(含答案)
- 運動技能學習與控制課件第四章感覺系統(tǒng)對運動控制的作用
評論
0/150
提交評論