C課程設(shè)計(jì)學(xué)生成績管理系統(tǒng)結(jié)構(gòu)數(shù)組實(shí)現(xiàn)_第1頁
C課程設(shè)計(jì)學(xué)生成績管理系統(tǒng)結(jié)構(gòu)數(shù)組實(shí)現(xiàn)_第2頁
C課程設(shè)計(jì)學(xué)生成績管理系統(tǒng)結(jié)構(gòu)數(shù)組實(shí)現(xiàn)_第3頁
C課程設(shè)計(jì)學(xué)生成績管理系統(tǒng)結(jié)構(gòu)數(shù)組實(shí)現(xiàn)_第4頁
C課程設(shè)計(jì)學(xué)生成績管理系統(tǒng)結(jié)構(gòu)數(shù)組實(shí)現(xiàn)_第5頁
免費(fèi)預(yù)覽已結(jié)束,剩余5頁可下載查看

下載本文檔

版權(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)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論