學(xué)生成績(jī)管理系統(tǒng)源代碼_第1頁
學(xué)生成績(jī)管理系統(tǒng)源代碼_第2頁
學(xué)生成績(jī)管理系統(tǒng)源代碼_第3頁
學(xué)生成績(jī)管理系統(tǒng)源代碼_第4頁
學(xué)生成績(jī)管理系統(tǒng)源代碼_第5頁
已閱讀5頁,還剩8頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、#include #include #include #include struct student char no9; char name20; int score4; float aver; float sum;void menu()/ 菜單 printf( tt學(xué)生成績(jī)管理系統(tǒng)n);printf(tt*菜單 *n);printf(tt* 1錄入成績(jī)2刪除成績(jī)*n);printf(tt* 3查詢成績(jī)4修改成績(jī)*n);printf(tt* 5插入成績(jī)6具體查看*n);printf(tt* 7成績(jī)排序8保存成績(jī)*n);printf(tt* 9顯示成績(jī)0退出系統(tǒng)*n);printf(tt*n);

2、printf(n);void input(struct student *stu,int *n)/ 錄入成績(jī)int i=*n;int k=1;int a,b;system(cls);printf(tttt 錄入成績(jī) n);while(k)printf(tt 請(qǐng)輸入學(xué)號(hào): );scanf(%s,stui.no);printf(tt 請(qǐng)輸入姓名: );scanf(%s,);printf(tt 請(qǐng)輸入語文成績(jī): ); scanf(%d,&stui.score0); printf(tt 請(qǐng)輸入數(shù)學(xué)成績(jī): );scanf(%d,&stui.score1); printf(tt 請(qǐng)輸入英

3、語成績(jī): );scanf(%d,&stui.score2); printf(tt 請(qǐng)輸入 C 語言成績(jī): );scanf(%d,&stui.score3);printf(tt 繼續(xù)錄入請(qǐng)輸入 1,終止錄入請(qǐng)輸入 0:); scanf(%d,&k);i+;(*n)+;for(a=0;ai;a+) /sum aver 歸零stua.sum=0;stua.aver=0;for(a=0;ai;a+)/ 計(jì)算總分 for(b=0;b4;b+)stua.sum+=stua.scoreb;for(a=0;ai;a+)/ 計(jì)算平均分stua.aver=stua.sum/4; system(pause);voi

4、d dele(struct student *stu,int *n)/ 刪除成績(jī) system(cls); int i;char number9,name9;printf(tt 請(qǐng)輸入您要?jiǎng)h除該同學(xué)的學(xué)號(hào): ); scanf(%s,number);printf(tt 請(qǐng)輸入您要?jiǎng)h除該同學(xué)的姓名: ); scanf(%s,name);for(i=0;i*n;i+) if(strcmp(stui.no,number)=0 & strcmp(,name)=0) for(;i(*n-1);i+) stui=stui+1;(*n)-; break;printf(tt 刪除成功! );v

5、oid search(struct student *stu,int n)/ 查詢成績(jī) system(cls);int i,a=1;char number9;char name20; while(a)printf(tt 請(qǐng)輸入您的學(xué)號(hào): ); scanf(%s,&number);printf(tt 請(qǐng)輸入您的姓名: ); scanf(%s,&name);for(i=0;in;i+)if(strcmp(stui.no,number)=0 & strcmp(,name)=0 )printf(tprintf(n);printf(t|學(xué)號(hào) |姓名均分 |n);printf(t|%-5

6、s%-6s | %-5.1f |n,成績(jī)單 n);語文 | 數(shù)學(xué) | 英語 | C 語言 | 總分 | 平%-4d| %-4d| %-4d| %-4d| %-3.1fstui.no,,stui.score0,stui.score1,stui.score2,stui.score3,stui.sum,stui.av er);a=0;elseprintf(tt 輸入有誤,請(qǐng)重新輸入! n); break;system(pause);void modify(struct student *stu,int n)/ 修改成績(jī)system(cls);char number9,name9;i

7、nt a,i,m=1,b;printf(t 根據(jù)學(xué)號(hào)來修改成績(jī)請(qǐng)輸入 1,根據(jù)姓名來修改成績(jī)請(qǐng)輸入 0。 n); scanf(%d,&a);doif(a=1)printf(tt 請(qǐng)輸入您要修改同學(xué)的學(xué)號(hào): );scanf(%s,number);for(i=0;in;i+)if(strcmp(stui.no,number)=0)printf(n);printf(t 成績(jī)單 n);printf(n);printf(t| 學(xué)號(hào) | 姓名 | 語文 | 數(shù)學(xué) | 英語 | C 語言 | 總分 | 平均分 |n);printf(t| %-5s | %-6s | %-4d| %-4d| %-4d| %-4

8、d| %-3.1f | %-5.1f |n,stui.no,,stui.score0,stui.score1,stui.score2,stui.score3,stui.sum,stui.av er);printf(tt 請(qǐng)輸入新的學(xué)號(hào): );scanf(%s,stui.no);printf(tt 請(qǐng)輸入新的姓名: );scanf(%s,);printf(tt 請(qǐng)輸入新的語文成績(jī): );scanf(%d,&stui.score0);printf(tt 請(qǐng)輸入新的數(shù)學(xué)成績(jī): );scanf(%d,&stui.score1);printf(tt 請(qǐng)輸入新的英語成績(jī)

9、: );scanf(%d,&stui.score2);printf(tt 請(qǐng)輸入新的 C 語言成績(jī): );scanf(%d,&stui.score3);m-;b=i;if(a=0)printf(tt 請(qǐng)輸入您要修改同學(xué)的姓名: ); scanf(%s,name);for(i=0;in;i+)if(strcmp(,name)=0)printf(n); printf(tprintf(n); printf(t|學(xué)號(hào) 成績(jī)單 n);| C 語言 | 總分| 姓名| 語文 | 數(shù)學(xué) | 英語| 平均分 |n);printf(t|%-5s| %-6s |%-4d| %-4d| %-4d|

10、%-4d| %-3.1f| %-5.1f |n,stui.no,,stui.score0,stui.score1,stui.score2,stui.score3,stui.sum,stui.aver);printf(tt 請(qǐng)輸入新的學(xué)號(hào): );scanf(%s,stui.no);printf(tt 請(qǐng)輸入新的姓名: );scanf(%s,);printf(tt 請(qǐng)輸入新的語文成績(jī): ); scanf(%d,&stui.score0);printf(tt 請(qǐng)輸入新的數(shù)學(xué)成績(jī): ); scanf(%d,&stui.score1);printf(tt 請(qǐng)輸入新的英

11、語成績(jī): );scanf(%d,&stui.score2); printf(tt 請(qǐng)輸入新的 C 語言成績(jī): );scanf(%d,&stui.score3);m-;b=i;while(m);printf(tt 該同學(xué)修改后的成績(jī)?yōu)椋?n);printf(tprintf(n); printf(t|成績(jī)單學(xué)號(hào) |姓名n);| 總分| 語文| 數(shù)學(xué) | 英語| C 語言| 平均分 |n);printf(t|%-5s |%-6s |%-4d|%-4d| %-4d|%-4d|%-3.1f| %-5.1f |n,stub.no,,stub.score0,stub.score1,stub

12、.score2,stub.score3,stub.sum,stu b.aver);system(pause);void insert(struct student *stu,int *n)/ 插入成員 /*system(cls);int i,j,a;printf( 插入學(xué)生成績(jī)! );printf();scanf(%d,&a);doif(a=1)(*n)+;*/ void count(struct student *stu,int n)/ 成績(jī)?cè)斍?system(cls);int a=0,b=0,c=0,d=0;int i;for(i=0;in;i+)/ 計(jì)算語文不及格人數(shù)if(stui.sc

13、ore060) a+;for(i=0;in;i+)/ 計(jì)算數(shù)學(xué)不及格人數(shù)if(stui.score160) b+;for(i=0;in;i+)/ 計(jì)算英語不及格人數(shù)if(stui.score260) c+;for(i=0;in;i+)/ 計(jì)算 C 語言不及格人數(shù)if(stui.score360) a+;for(i=0;in;i+)/ 計(jì)算語文不及格人數(shù)if(stui.score160) d+;printf(tt語文不及格人數(shù)為:%d個(gè)n”,a); printf(tt數(shù)學(xué)不及格人數(shù)為:%d個(gè)n”,b); printf(tt英語不及格人數(shù)為:d個(gè)n”,c); printf(ttC語言不及格人數(shù)為:

14、%d個(gè)n,d); system(pause);void sort(struct student *stu,int n)/ 成績(jī)排序 system(cls);int a,i,j; struct student k;printf( 按學(xué)號(hào)排序請(qǐng)輸入1、按總分高低排序請(qǐng)輸入0: );scanf(%d,&a);if(a=1)for(i=0;in-1;i+)for(j=0;j0)k=stuj;stuj=stuj+1; stuj+1=k;printf(tt140705 班學(xué)生成績(jī) n);printf( 成績(jī)單 n);printf(n);printf(|學(xué)號(hào)|姓名|語文|數(shù)學(xué)|英語| C語言|總分|平均分|

15、n);for(i=0;in;i+)printf(| %-5s | %-6s |%-4d|%-4d|%-4d|%-4d|%-3.1f |%-5.1f |n,stui.no,,stui.score0,stui.score1,stui.score2,stui.score3,stui.sum,stui.av er);printf(n);printf(n);system(pause);return;if(a=0)for(i=0;in-1;i+)for(j=0;jn-i;j+)if(stuj.sumstuj+1.sum)k=stuj; stuj=stuj+1; stuj+1=k;prin

16、tf(140705 班學(xué)生成績(jī) n);printf( 成績(jī)單 n);printf(n);printf(| 學(xué)號(hào) | 姓名 | 語文 | 數(shù)學(xué) | 英語 | C 語言 | 總分 | 平均分 | 名 次 |n);for(i=0;i 打開錯(cuò)誤 !n); getchar();return;printf( %d,n);system(pause);for(i=0;i0)getchar;printf(nnn= 已保存的學(xué)生信息的總數(shù)為 :%dn,n); getchar();savingflag=0;else system(cls);printf( 當(dāng)前無保存的學(xué)生信息 !n); getchar();fclo

17、se(fp); system(pause);void display(struct student *stu,int n)/ 顯示成績(jī)system(cls);int i;printf(tt140705 班學(xué)生成績(jī) ); printf(n);if(n=0)printf(tt 無成績(jī)! n);system(pause);return;printf(t 成績(jī)單 n);printf(n);printf(t| 學(xué)號(hào) | 姓名 | 語文 | 數(shù)學(xué) | 英語 | C 語言 | 總分 | 平均分 |n); for(i=0;ican not open file!n); exit(0);while(!feof(f

18、p)if(fread(stu+i,sizeof(struct student),1,fp)=1)/ 一次從文件讀取一條學(xué)生成績(jī)記錄 i+;*n=i;fclose(fp);/ 關(guān)閉文件void main()/ 登錄界面 system(cls); struct student stu100; struct student *p; int n=0; system(color 0B); char a10=140705,b10=123456; char c10,d10; int h=5; read(stu,&n);printf(tt* 歡迎進(jìn)入學(xué)生成績(jī)管理系統(tǒng)! *n); printf(n);printf(n);printf(tttt 用戶登錄 n);printf(tt 請(qǐng)輸入用戶名: ); scanf(%s,c);printf(tt

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論