




下載本文檔
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
1、學(xué)生成績管理系統(tǒng)Void printf “此為用結(jié)構(gòu)數(shù)組實(shí)現(xiàn)對學(xué)生成績的管理 系統(tǒng),功能有錄入學(xué)生成績,對應(yīng)查找功能,可增加學(xué) 生功能,學(xué)生成績排序(利用冒泡,學(xué)生平均分比較, 即可排名),當(dāng)然也可計(jì)算各科平均分,對個(gè)分?jǐn)?shù)段人 數(shù)進(jìn)行排名,可謂功能齊全,已在C程序下運(yùn)行過,毫無 問題;” ;以上內(nèi)容,勿copy,純屬譯文;以下才是程序核心,歡 迎收藏,如不,直接 break 跳出吧.h>#include < stdio .h> #include < stdlib .h> #include < string int s; int t;/ 輸入/ 排序/ 顯示/
2、 顯示各科成績/ 插入/ 平均值/ 查找/ 修改/ 分?jǐn)?shù)段/ 各科平均數(shù)#define N 10 void shuru(); void paixu(); void display(); void display1(); void charu(); void average(); void find(); void xiugai(); void fshdrsh(); void ave2();void xuanze() printf( "t1 輸入學(xué)生資料 ttttt2 printf( "t3 對平均分排序 ttttt4 printf( "t5 修改學(xué)生信息 tttt
3、t6 printf( "t7 分?jǐn)?shù)段人數(shù)顯示學(xué)生信息 n" );添加學(xué)生信息 n" ); 查詢學(xué)生信息 n" );tt 8各科平均分n");printf( "t9 退出 n" );printf( "tt -n" );name20; score1; score2; score3; score4; sort; ave;int now_no= 0; struct student int no; char float float float float float floatint mingci;struct s
4、tudent stuN;void main() /*主函數(shù) */printf( "t* 學(xué)生成績管理系統(tǒng)*)n; "printf( "D數(shù)加工 101 丁紹學(xué) 231100117nn ");do xuanze();scanf( "%d" ,&s);switch (s)case 1:shuru();break ; case 2:display();break ; case 3:paixu();break ; case 4:charu();break ; case 5:xiugai();break ; case 6:find();
5、 break ; case 7:fshdrsh(); break ; case 8:ave2();break ;case 9:exit(0) ; break ;default :printf("輸入錯(cuò)誤 ”);break ; while(s!=9);/* 輸入*/void shuru()int i=0;char ch;doprintf("輸入第%d個(gè)學(xué)生的信息n" ,i+1); printf( "n 學(xué)號:");scanf( "%d" ,&stui .no);printf( "n 姓名:");sc
6、anf( "%s" ,&stui .name);printf( "nC 語言程序設(shè)計(jì)成績 :");scanf( "%f" ,&stui .score1);printf( "n 高等數(shù)學(xué)成績 :");scanf( "%f" ,&stui .score2);printf( "n 英語成績 :");scanf( "%f" ,&stui .score3);printf( "n 線性代數(shù)成績 :");scanf(
7、"%f" ,&stui .score4);printf( "nn" );i+;now_no=i; ch=getchar();printf( "是否繼續(xù)輸入 ?(Y/N)"); scanf( "%c" ,&ch);/*排序*/whi l e (ch!= 'n' && ch != 'N' ) ; void paixu() int i,j;struct student t;for (i= 1;i< now_no;i+ ) for (j =1;j<
8、= now_no- i;j+ ) if (stuj-1 .ave< stuj .ave)t = stuj; stuj =stuj - 1; stuj - 1=t;for (i=0;i<= now_no;i+) /*名次*/stui .mingci=i+1; void average()int i;for (i= 0;i< now_no;i+ )stui .ave=(stui .score1+ stui .score2 +stui .score3 +stui .score4) / 4;void display()/* 顯示 */int i;char a; average();d
9、o printf( "ttt 班級學(xué)生信息列表 n" );printf("學(xué)號t姓名tC語言程序設(shè)計(jì)t高等數(shù)學(xué)t英語t線性代數(shù) 平均值 t 名次n");for (i=0;i<now_no;i+ )printf( "%dt%st%.2ftt%.2ftt%.2ft%.2ft %.2ft %dn",stui .no,stui .name,stui .score1,stui .score2,stui .score3,stui .score4,stui .ave,stui .mingci)scanf( "%d" ,&a
10、mp;a); while(a= 2);/* 插入*/ void charu()char ch; do printf( "ntt 插入新學(xué)生信息 n" ); printf( "n 學(xué)號 :");scanf( "%d" ,&stunow_no .no); printf( "n 姓名 :");scanf( "%s" ,stunow_no .name); printf( "nC 語言程序設(shè)計(jì)成績 :");scanf( "%f" ,&stunow_n
11、o .score1); printf( "n 高等數(shù)學(xué)成績 :");scanf( "%f" ,&stunow_no .score2); printf( "n 英語成績 :");scanf( "%f" ,&stunow_no .score3); printf( "n 線性代數(shù)成績 :");scanf( "%f" ,&stunow_no .score4); now_no+ ;printf( "nn" );paixu();ch=getch
12、ar();printf( "是否繼續(xù)輸入 ?(Y/N)" ); scanf( "%c" ,&ch);while(ch!='n'&& ch !='N' );/*查找*/ void find()int i;char str20,a;doprintf( " 輸入要查詢的學(xué)生姓名 :");scanf( "%s" ,&str); for (i= 0;i< now_no;i+ ) if(strcmp(stui .name,str) =0) printf(&q
13、uot;學(xué)號t姓名tC語言程序設(shè)計(jì)t高等數(shù)學(xué)t英語t線性代數(shù) t平均值t名次n");printf( "%dt%st%.2ft%.2ft%.2ft%.2f %.2ft %dn" ,stui .no,stui .name,s tui .score1,stui .score2,stui .score3,stui .score4,stui .ave,stui .mingci);scanf( "%c" ,&a); while(!a);void xiugai() /* 修改*/int i;char str20;printf( "輸入要修改
14、的學(xué)生姓名 :"); scanf( "%s" ,&str);for(i=0;i<now_no;i+ )if(strcmp(stui .name,str) =0)printf( "ntt 輸入新的學(xué)生信息 n" ); printf( "n 學(xué)號:");scanf( "%d" ,&stui .no);printf( "nC 語言程序設(shè)計(jì)成績 :"); scanf( "%f" ,&stui .score1) ;printf( "n
15、高等數(shù)學(xué)成績 :"); scanf( "%f" ,&stui .score2) ;printf( "n 英語成績 :"); scanf( "%f" ,&stui .score3) ;printf( "n 線性代數(shù)成績 :"); scanf( "%f" ,&stui .score4) ;printf( "nn" ); paixu();break ;void fshdrsh() /*分?jǐn)?shù)段 */int i;int count5 =0;int co
16、unt1 5 = 0;int count25 =0;int count35 =0;for (i=0;i<now_no;i+)if (stui .score 1 >= 0&& stui .score1 < 60) count0 + ;if (stui .score 1 >= 6 0&& stui .score 1 < 70) count1 +;if (stui .score 1 >= 70&& stui .score1 < 80) count2 +;if (stui .score 1 >= 8 0&a
17、mp;& stui .score 1 < 90) count3 +;if (stui .score 1 >= 90&& stui .score 1 <= 100) count4 + ; printf( printf( printf( printf( printf(,count0);,count1);,count2);,count3);,count4);"C語言程序設(shè)計(jì)成績 "C 語言程序設(shè)計(jì)成績 "C語言程序設(shè)計(jì)成績 "C語言程序設(shè)計(jì)成績 "C 語言程序設(shè)計(jì)成績060 分:dttttn"607
18、 0 分:%dttttn" 708 0 分:%dttttn"809 0 分:%dttttn" 90100分:%dttttn"printf( "n" );for (i=0;i<now_no;i+) if (stui .score2 >= 0&& stui .score2 < 60) count10+ ;if (stui .score2 >= 60&& stui .score2 <70) count11+ ;if (stui .score2 >= 70&&
19、stui .score2 < 80)count12 +;if(stui .score2 >= 80&&stui .score2 <90) count13 +;if(stui.score2>=90&&stui.score2<= 100) count14+ ; printf( printf( printf( printf( printf("高等數(shù)學(xué)成績060分:dttttn""高等數(shù)學(xué)成績 6070分:%dttttn""高等數(shù)學(xué)成績 7080分:%dttttn""高等
20、數(shù)學(xué)成績8090分:%dttttn""高等數(shù)學(xué)成績 90100分:%dttttn",count10);,count11);,count12);,count13);,count14);for (i=0;i<now_no;i+)if(stui .score3 >= 0&&stui .score3 <60) count20 + ;if(stui .score3 >= 60&&stui .score3 < 70) count21 +;if(stui .score3 >= 70&&stui
21、.score3 <80) count22 + ;if(stui .score3 >= 80&&stui .score3 < 90) count23 + ;if(stui .score3 >= 90&&stui .score3 <= 100) count24 + ;printf(printf(printf(printf("英語成績 8090分:%dttttn""英語成績 060分:%dttttn""英語成績 6070分:%dttttn""英語成績 7080分:%dt
22、tttn"printf("英語成績 90100分:%dttttn",count20);,count21);,count22);,count23);,count24);for (i=0;i<now_no;i+)if(stui .score4 >= 0&&stui .score4 < 60) count30 +;if(stui .score4 >= 60&&stui .score4 < 70) count31 +;if(stui .score4 >= 70&&stui .score4 < 80) count32 + ;if(stui .score4 >= 80&&stui .score4 < 90) count33 + ;if(stui .score4 >= 90&&stui .scor
溫馨提示
- 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)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- T-ZSM 0055-2024“領(lǐng)跑者”評價(jià)技術(shù)要求 燒結(jié)釹鐵硼永磁材料
- 2025年度資質(zhì)借用與投標(biāo)環(huán)境保護(hù)合作協(xié)議
- 二零二五年度智能交通管理系統(tǒng)單方解除合同
- 2025年度跨海大橋旋挖灌注樁施工合同
- 二零二五年度防盜門市場調(diào)研與采購合作協(xié)議
- 二零二五年度生物技術(shù)專利申請合作協(xié)議
- 二零二五年度體育健身公司聘用兼職教練合同書
- 二零二五年度勞務(wù)派遣公司勞動(dòng)合同范本(含合同解除與賠償)
- 四川省2025年度房屋租賃租賃合同解除與終止合同
- 二零二五年度消費(fèi)金融貸款連帶保證合同書
- 法規(guī)解讀丨2024新版《突發(fā)事件應(yīng)對法》及其應(yīng)用案例
- JGJ46-2024 建筑與市政工程施工現(xiàn)場臨時(shí)用電安全技術(shù)標(biāo)準(zhǔn)
- 旅游地產(chǎn)開發(fā)模式和創(chuàng)新(含案例)
- 診斷學(xué)完整教案(共167頁)
- 《汽車文化》全套教案
- 拆除工程檢驗(yàn)批質(zhì)量檢驗(yàn)記錄
- 甲狀腺腫瘤PPT課件
- 城市燃?xì)夤こ瘫O(jiān)理實(shí)施細(xì)則
- 項(xiàng)目總工崗位職責(zé)
- 鋁合金和工藝課件:硬質(zhì)陽極氧化處理
- (完整版)部編四年級語文下詞語表
評論
0/150
提交評論