學(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ō)明:本文檔由用戶(hù)提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

//成績(jī)管理系統(tǒng)v3.0//能動(dòng)1302王清棟1306030217#include<stdio.h>#include<stdlib.h>#include<string.h>#defineN30voidInput(longnum[],intscore[],intn,charname[][10]);voidTotalave(intscore[],intn);voidScoredes(longnum[],intscore[],intn,charname[][10]);voidScoreas(longnum[],intscore[],intn,charname[][10]);voidNumas(longnum[],intscore[],intn,charname[][10]);voidNameorder(longnum[],intscore[],intn,charname[][10]);voidSearchbyno(longnum[],intscore[],intn,intx,charname[][10]);voidSearchbyname(longnum[],intscore[],intn,charc[],charname[][10]);voidstatistis(intscore[],intn);voidList(longnum[],intscore[],intn,charname[][10]);intmain(){intn,score[N],c,x;longnum[N];charname[N][10];chary[10];printf("輸入學(xué)生人數(shù)");scanf("%d",&n);//getchar();printf("1.Inputrecord\n");printf("2.Caculatetotelandaveragescoreofeverycourse\n");printf("3.Sortindescendingorderbyscore\n");printf("4.Sortinascendingorderbyscore\n");printf("5.Sortinascendingorderbynumber\n");printf("6.Sortindictionaryorderbyname\n");printf("7.Searchbynumber\n");printf("8.searchbyname\n");printf("9.Statisticanalysis\n");printf("10.Listrecord\n");printf("0.Exit\n");printf("Pleaseenteryourchoice:\n");printf("\n");for(;;){scanf("%d",&c);switch(c){case1://錄入學(xué)生學(xué)號(hào)和各科成績(jī)Input(num,score,n,name);printf("Pleaseenteryourchoice:\n");break;case2://計(jì)算每門(mén)課程的總分和平均分Totalave(score,n);printf("Pleaseenteryourchoice:\n");break;case3://按chengji由高到低排出名次表Scoredes(num,score,n,name);printf("Pleaseenteryourchoice:\n");break;case4://按chengji由低到高排出名次表Scoreas(num,score,n,name);printf("Pleaseenteryourchoice:\n");break;case5://按學(xué)號(hào)由小到大排出名次表Numas(num,score,n,name);printf("Pleaseenteryourchoice:\n");break;case6://按學(xué)號(hào)由小到大排出名次表Nameorder(num,score,n,name);printf("Pleaseenteryourchoice:\n");break;case7://按學(xué)號(hào)查詢(xún)學(xué)生排名及其各科成績(jī)printf("請(qǐng)輸入查找學(xué)號(hào)\n");scanf("%d",&x);Searchbyno(num,score,n,x,name);printf("Pleaseenteryourchoice:\n");break;case8://按姓名查詢(xún)學(xué)生排名及其各科成績(jī)printf("請(qǐng)輸入查找姓名\n");getchar();gets(y);Searchbyname(num,score,n,y,name);break;printf("Pleaseenteryourchoice:\n");case9://成績(jī)分析所占百分比statistis(score,n);printf("Pleaseenteryourchoice:\n");break;case10://全部輸出List(num,score,n,name);printf("Pleaseenteryourchoice:\n");break;k=j;}if(i!=k){t=score[k],h=num[k],strcpy(temp,name[k]);score[k]=score[i],num[k]=num[i],strcpy(name[k],name[i]);score[i]=t,num[i]=h,strcpy(name[i],temp);}}while(find==0&&low<=high){mid=(high+low)/2;if(x>num[mid])low=mid+1;elseif(x<num[mid])high=mid-1;else{pos=mid;find=1;}}if(find==0)printf("notfind\n");else{for(i=0;i<n;i++){if(score[i]>score[pos])c++;}printf("ID:%10ld,name:%s,order:%d,",num[pos],name[pos],c);//以長(zhǎng)整形打印用%ldprintf("score:%d\n",score[pos]);}}voidSearchbyname(longnum[],intscore[],intn,charc[],charname[][10])//8。按姓名查詢(xún)學(xué)生排名及其考試成績(jī){inti,pos=-1,d=1;for(i=0;i<n;i++){if(strcmp(name[i],c)==0)pos=i;}if(pos==-1)printf("notfind\n");else{for(i=0;i<n;i++){if(score[i]>score[pos])d++;}}printf("ID:%10ld,name:%s,order:%d,",num[pos],name[pos],d);//以長(zhǎng)整形打印用%ldprintf("score:%d\n",score[pos]);}voidstatistis(intscore[],intn)//9.案優(yōu)秀良好中等及格不及格5個(gè)類(lèi)別,統(tǒng)計(jì)每個(gè)類(lèi)別的人數(shù)以及所占的百分比{inta=0,b=0,c=0,d=0,e=0,i;doubleA,B,C,D,E;for(i=0;i<n;i++){if(score[i]>=90)a++;elseif(score[i]>=80)b++;elseif(score[i]>=70)c++;elseif(score[i]>=60)d++;elsee++;}A=(double)a/n*100;B=(double)b/n*100;C=(double)c/n*100;D=(double)d/n*100;E=(double)e/n*100;printf("優(yōu)秀人數(shù)%d,百分比:%f%%\n",a,A);printf("良好人數(shù)%d,百分比:%f%%\n",b,B);printf("中等人數(shù)%d,百分比:%f%%\n",c,C);printf("及格人數(shù)%d,百分比:%f%%\n",d,D);printf("不及格人數(shù)%d,百分比:%f%%\n",e,E);}voidList(longnum[],intscore[],intn,charname[][10])//10輸出每個(gè)學(xué)生的學(xué)號(hào),考試成績(jī)姓名,以及課程總分

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶(hù)所有。
  • 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ì)用戶(hù)上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶(hù)上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶(hù)因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論