



下載本文檔
版權(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)v2.0#include #include #define N 30void Input (long num,int score,int n);void Totalave (int score,int n);void Scoredes (long num,int score,int n,int (*compare)(int a,int b);int Ascending (int a,int b);void Numas (long num,int score,int n);void Search (long num,int score,int n,int x);void stat
2、istis (long num,int score,int n);void List (long num,int score,int n);int main() int n,scoreN,c,x,i; long numN; printf(輸入學(xué)生人數(shù)); scanf(%d,&n); printf(1.Input recordn); printf(2.Caculate totel and average score of coursen); printf(3.Sort in descending order by scoren); printf(4.Sort in ascending order
3、 by numbern); printf(5.Search by numbern); printf(6.Statistic analysisn); printf(7.List recordn); printf(0.Exitn); printf(Please enter your choice:n); printf(n); for(;) scanf(%d,&c); switch(c) case 1: Input (num,score,n); printf(Please enter your choice:n); break; case 2: Totalave (score,n); printf(
4、Please enter your choice:n); break; case 3: Scoredes (num,score,n,Ascending); for(i=0;in;i+) printf(ID:%10ld,score:%dn,numi,scorei);/以長(zhǎng)整形打印用%ld printf(Please enter your choice:n); break; case 4: Numas (num,score,n); printf(Please enter your choice:n); break; case 5: printf(請(qǐng)輸入查找學(xué)號(hào)n); scanf(%d,&x); S
5、earch (num,score,n,x); printf(Please enter your choice:n); break; case 6: statistis (num,score,n); printf(Please enter your choice:n); break; case 7: List (num,score,n); Totalave (score,n); printf(Please enter your choice:n); break; case 0: exit(0); return 0;void Input (long num,int score,int n) int
6、 i; for(i=0;in;i+) printf(Input students ID and score); scanf(%ld%d,&numi,&scorei); void Totalave (int score,int n) int i,sum=0; double ave; for(i=0;in;i+) sum=sum+scorei; ave=(double)sum/n; printf(Caculate total=%d,average score of course=%fn,sum,ave);void Scoredes (long num,int score,int n,int(*co
7、mpare)(int a,int b) int i,j,k,t,h; for(i=0;in;i+) k=i; for(j=i+1;jn;j+) if (*compare)(scorej,scorek) k=j; if(i!=k) t=scorek,h=numk; scorek=scorei,numk=numi; scorei=t,numi=h; int Ascending (int a,int b) return ab;void Numas (long num,int score,int n) int i,j,k,t,h; for(i=0;in;i+) k=i; for(j=i+1;jn;j+
8、) if (numjnumk) k=j; if(i!=k) t=scorek,h=numk; scorek=scorei,numk=numi; scorei=t,numi=h; for(i=0;in;i+) printf(ID:%10ld,score:%dn,numi,scorei);/以長(zhǎng)整形打印用%ldvoid Search (long num,int score,int n,int x) int high=n-1,low=0,mid,c=0,pos,find=0,i,j,k,t,h; for(i=0;in;i+) k=i; for(j=i+1;jn;j+) if (numjnumk) k
9、=j; if(i!=k) t=scorek,h=numk; scorek=scorei,numk=numi; scorei=t,numi=h; while(find=0&lownummid) low=mid+1; else if(xnummid) high=mid-1; else pos=mid; find=1; if(find=0) printf(not findn); else for(i=0;iscorepos) c+; printf(ID:%10ld,order:%d,score:%dn,numpos,c+1,scorepos); void statistis (long num,in
10、t score,int n) int a=0,b=0,c=0,d=0,e=0,i; double A,B,C,D,E; for(i=0;i=90) a+; else if(scorei=80) b+; else if(scorei=70) c+; else if(scorei=60) d+; else e+; 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);
溫馨提示
- 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ì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年度法律服務(wù)團(tuán)隊(duì)聘用合同范本下載
- 2025年度音樂(lè)噴泉與音響系統(tǒng)集成項(xiàng)目合同
- 知識(shí)產(chǎn)權(quán)教育實(shí)踐活動(dòng)計(jì)劃
- 科技創(chuàng)新應(yīng)用推廣工作方案計(jì)劃
- 學(xué)期后勤保障與支持計(jì)劃
- 2025年物位儀合作協(xié)議書(shū)
- 培養(yǎng)小學(xué)生的公民道德責(zé)任計(jì)劃
- 制定年度客戶滿意度提升計(jì)劃
- 如何構(gòu)建長(zhǎng)效的職業(yè)發(fā)展體系計(jì)劃
- 校園美術(shù)文化建設(shè)方案計(jì)劃
- 國(guó)內(nèi)外創(chuàng)造性思維培養(yǎng)模式的對(duì)比研究綜述
- 2022年露天煤礦安全資格證考試題庫(kù)-上(單選、多選題庫(kù))
- MIL-STD-1916 抽樣技術(shù) (C=0 零不良)
- 計(jì)價(jià)格(2002)10號(hào)文
- 膠合板公司人員招聘與配置(模板)
- 團(tuán)建方案版攻防箭對(duì)戰(zhàn)
- 樁身強(qiáng)度自動(dòng)驗(yàn)算表格Excel
- 《鋼鐵是怎樣煉成的》讀書(shū)報(bào)告
- 燃?xì)廨啓C(jī)LM2500介紹
- (精選)淺談在小學(xué)數(shù)學(xué)教學(xué)中如何進(jìn)行有效提問(wèn)
- 堆垛機(jī)速度計(jì)算表
評(píng)論
0/150
提交評(píng)論