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

下載本文檔

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

文檔簡(jiǎn)介

1、/成績(jī)管理系統(tǒng)v3.0 / 能動(dòng)1302 王清棟 1306030217#include stdio。h>include <stdlib.h>include <string.hdefine N 30void Input (long num,int score,intn,char name10);void Totalave (int score,int n);void Scoredes (long num,int score,intn,char name10);void Scoreas (long num,int score,intn,char name10);void N

2、umas (long num,int score,intn,char name10);void Nameorder(long num,int score,intn,char name10) ;void Searchbyno (long num,int score,intn,intx,char name10);void Searchbyname(long num,int score,intn,char c,char name10);void statistis (int score,int n);void List (long num,int score,intn,char name10);in

3、t main() intn,scoreN,c,x; long numN; char nameN10; char y10;printf(”輸入學(xué)生人數(shù)");scanf("d",&n); / getchar();printf(”1.Input recordn”);printf(”2。Caculate totel and average score of every coursen”);printf("3。Sort in descending order by scoren");printf(”4。Sort in ascending orde

4、r by score n”);printf(”5。Sort in ascending order by numbern");printf(”6。Sort in dictionary order by namen”);printf(”7。Search by numbern”);printf(”8。search by namen”);printf(”9。Statistic analysisn”);printf("10。List recordn”);printf(”0.Exitn”);printf(”P(pán)lease enter your choice:n”);printf(&quo

5、t;n”); for(;) scanf(”d",c); switch(c) case 1: /錄入學(xué)生學(xué)號(hào)和各科成績(jī) Input (num,score,n,name);printf(”P(pán)lease enter your choice:n"); break; case 2: /計(jì)算每門(mén)課程的總分和平均分Totalave (score,n);printf(”P(pán)lease enter your choice:n"); break; case 3: /按chengji由高到低排出名次表Scoredes (num,score,n,name);printf(”P(pán)lease e

6、nter your choice:n”); break; case 4: /按chengji由低到高排出名次表Scoreas (num,score,n,name);printf("Please enter your choice:n”); break; case 5: /按學(xué)號(hào)由小到大排出名次表Numas (num,score,n,name);printf(”P(pán)lease enter your choice:n”); break; case 6: /按學(xué)號(hào)由小到大排出名次表Nameorder (num,score,n,name);printf("Please enter y

7、our choice:n”); break; case 7: /按學(xué)號(hào)查詢學(xué)生排名及其各科成績(jī)printf(”請(qǐng)輸入查找學(xué)號(hào)n");scanf(”d”,x);Searchbyno (num,score,n,x,name);printf("Please enter your choice:n"); break; case 8: /按姓名查詢學(xué)生排名及其各科成績(jī)printf("請(qǐng)輸入查找姓名n");getchar(); gets(y);Searchbyname (num,score,n,y,name); break;printf(”P(pán)lease e

8、nter your choice:n"); case 9: /成績(jī)分析所占百分比statistis (score,n);printf("Please enter your choice:n”); break; case 10: /全部輸出 List (num,score,n,name);printf("Please enter your choice:n"); break; case 0: exit(0); return 0; void Input (long num,int score,intn,char name10) /1inti; for(i=0

9、;in;i+) printf(”Input student's ID ,name and score”);scanf(”%ld”,numi);scanf(”%s”,namei);scanf(”%d",scorei); /getchar(); void Totalave (int score,int n) /2。計(jì)算課程的總分和平均分inti,sum=0; double ave; for(i=0;i<n;i+) sum=sum+scorei; ave=(double)sum/n;printf(”總分=d,課程的平均分=fn”,sum,ave);void Scoredes

10、(long num,int score,intn,char name10) /3。按學(xué)生的分由高到低排出名次表inti,j,k,t,h; char temp10; for(i=0;in;i+) k=i; for(j=i+1;jn;j+) if (scorejscorek) k=j; if(i!=k) t=scorek,h=numk,strcpy(temp,namek); scorek=scorei,numk=numi,strcpy(namek,namei); scorei=t,numi=h,strcpy(namei,temp); for(i=0;in;i+)printf(”ID:10ld,na

11、me:s,score:%dn",numi,namei,scorei);/以長(zhǎng)整形打印用%ldvoid Scoreas (long num,int score,intn,char name10) /4.按學(xué)生的分由高到低排出名次表inti,k,t,h,j; char temp10; for(i=0;in;i+) k=i; for(j=i+1;j<n;j+) if (scorej<scorek) k=j; if(i!=k) t=scorek,h=numk,strcpy(temp,namek); scorek=scorei,numk=numi,strcpy(namek,name

12、i); scorei=t,numi=h,strcpy(namei,temp); for(i=0;in;i+)printf(”ID:%10ld,name:s,score:dn",numi,namei,scorei);/以長(zhǎng)整形打印用%ldvoid Numas (long num,int score,intn,char name10) /5.按學(xué)號(hào)由小到大排出名次表inti,k,h,t,j; char temp10; for(i=0;in;i+) k=i; for(j=i+1;jn;j+) if (numj<numk) k=j; if(i!=k) t=scorek,h=numk,s

13、trcpy(temp,namek); scorek=scorei,numk=numi,strcpy(namek,namei); scorei=t,numi=h,strcpy(namei,temp); for(i=0;in;i+) printf(”ID:10ld,name:%s,score:%dn”,numi,namei,scorei);/以長(zhǎng)整形打印用ld void Nameorder(long num,int score,intn,char name10) /6.按姓名的字典順序排出成績(jī)表inti,k,t,h; char temp10; for(i=0;in;i+) for(k=i+1;kn

14、;k+) if(strcmp(namei,namek)0) t=scorek,h=numk,strcpy(temp,namek); scorek=scorei,numk=numi,strcpy(namek,namei); scorei=t,numi=h,strcpy(namei,temp); for(i=0;in;i+) printf(”ID:%10ld,name:%s,score:dn",numi,namei,scorei);/以長(zhǎng)整形打印用ld void Searchbyno (long num,int score,intn,intx,char name10) /7。按學(xué)號(hào)查詢學(xué)

15、生排名及考試成績(jī)int high=n1,low=0,mid,c=1,pos,find=0,i,k,h,j,t; char temp10; for(i=0;in;i+) k=i; for(j=i+1;j<n;j+) if (numjnumk) k=j; if(i!=k) t=scorek,h=numk,strcpy(temp,namek); scorek=scorei,numk=numi,strcpy(namek,namei); scorei=t,numi=h,strcpy(namei,temp); while(find=0&low=high) mid=(high+low)/2;

16、if(xnummid) low=mid+1; else if(xnummid) high=mid1; else pos=mid; find=1; if(find=0)printf(”not findn”); else for(i=0;in;i+) if(scorei>scorepos)c+; printf("ID:10ld,name:s,order:d,",numpos,namepos,c);/以長(zhǎng)整形打印用ldprintf(”score:dn",scorepos); void Searchbyname(long num,int score,intn,cha

17、r c,char name10)/8。按姓名查詢學(xué)生排名及其考試成績(jī)inti,pos=1,d=1; for(i=0;i<n;i+) if(strcmp(namei,c)=0)pos=i; if(pos=1)printf(”not findn"); else for(i=0;in;i+) if(scoreiscorepos) d+; printf(”ID:10ld,name:%s,order:%d,”,numpos,namepos,d);/以長(zhǎng)整形打印用ldprintf(”score:dn”,scorepos);void statistis (int score,int n) /

18、9。案優(yōu)秀良好中等及格不及格5個(gè)類別,統(tǒng)計(jì)每個(gè)類別的人數(shù)以及所占的百分比int a=0,b=0,c=0,d=0,e=0,i; double A,B,C,D,E; for(i=0;in;i+) if(scorei=90) a+; else if(scorei=80) b+; else if(scorei=70)c+; else if(scorei=60) d+; else e+; A=(double)a/n100; B=(double)b/n100; C=(double)c/n100; D=(double)d/n100; E=(double)e/n100;printf(”優(yōu)秀人數(shù)d,百分比:f%n”,a,A);printf("良好人數(shù)d,百分比:%f%n",b,B);printf(”中等人數(shù)d,百分比:%fn”,c,C);printf(”及格人數(shù)d,百分比:%f%n”,d,D)

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 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)論