C语言大作业——学生成绩管理系统v2..pdf

上传人:l*** 文档编号:80688636 上传时间:2023-03-23 格式:PDF 页数:9 大小:185.14KB
返回 下载 相关 举报
C语言大作业——学生成绩管理系统v2..pdf_第1页
第1页 / 共9页
C语言大作业——学生成绩管理系统v2..pdf_第2页
第2页 / 共9页
点击查看更多>>
资源描述

《C语言大作业——学生成绩管理系统v2..pdf》由会员分享,可在线阅读,更多相关《C语言大作业——学生成绩管理系统v2..pdf(9页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。

1、/成绩管理系统#include#include#define N 30 void 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 statistis(long nu

2、m,int score,int n);void List(long num,int score,int n);int main()int n,scoreN,c,x,i;long numN;printf(输入学生人数);scanf(%d,&n);printf(recordn);printf(totel and average score of coursen);printf(in descending order by scoren);printf(in ascending order by numbern);printf(by numbern);printf(analysisn);printf

3、(recordn);printf(n);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(Please enter your choice:n);break;case 3:Scoredes(num,score,n,Ascending);for(i=0;in;i+)printf(ID:%10ld,score

4、:%dn,numi,scorei);/以长整形打印用%ld printf(Please enter your choice:n);break;case 4:Numas(num,score,n);printf(Please enter your choice:n);break;case 5:printf(请输入查找学号n);scanf(%d,&x);Search(num,score,n,x);printf(Please enter your choice:n);break;case 6:statistis(num,score,n);printf(Please enter your choice:

5、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 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;

6、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(*compare)(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,n

7、umi=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+)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);/以长整形打印用%ld void Search(long num,int scor

8、e,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=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;isc

9、orepos)c+;printf(ID:%10ld,order:%d,score:%dn,numpos,c+1,scorepos);void statistis(long num,int 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(优秀人数%d,百分比:%f%n,a,A);printf(良好人数%d,百分比:%f%n,b,B);printf(中等人数%d,百分比:%f%n,c,C);printf(及格人数%d,百分比:%f%n,d,D);printf(不及格人数%d,百分比:%f%n,e,E);void List(long num,int score,int n)int i;for(i=0;in;i+)printf(ID:%10ld,score:%dn,numi,scorei);

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 应用文书 > 解决方案

本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知淘文阁网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

工信部备案号:黑ICP备15003705号© 2020-2023 www.taowenge.com 淘文阁