收藏 分销(赏)

新版学生成绩标准管理系统.doc

上传人:a199****6536 文档编号:2827532 上传时间:2024-06-06 格式:DOC 页数:13 大小:35.04KB
下载 相关 举报
新版学生成绩标准管理系统.doc_第1页
第1页 / 共13页
新版学生成绩标准管理系统.doc_第2页
第2页 / 共13页
新版学生成绩标准管理系统.doc_第3页
第3页 / 共13页
新版学生成绩标准管理系统.doc_第4页
第4页 / 共13页
新版学生成绩标准管理系统.doc_第5页
第5页 / 共13页
点击查看更多>>
资源描述

1、/成绩管理系统v1.0 / 能动1302 王清栋 #include #include #define N 30#define M 6void Input (long num,int scoreM,int n,int m);void Totalave (int scoreM,int n,int m);void evestuTotalave (int scoreM,int n,int m,long num);void Scoredes (long num,int scoreM,int n,int m);void Scoreas (long num,int scoreM,int n,int m);v

2、oid Numas (long num,int scoreM,int n,int m);void Search (long num,int scoreM,int n,int x,int m);void statistis (long num,int scoreM,int n,int m);void List (long num,int scoreM,int n,int m);int main() int n,scoreNM,c,x,m; long numN; printf(输入学生人数); scanf(%d,&n); printf(输入考试科目); scanf(%d,&m); printf(1

3、.Input recordn); printf(2.Caculate totel and average score of every coursen); printf(3.Caculate totel and average score of every studentn); printf(4.Sort in descending order by total score of every studentn); printf(5.Sort in ascending order by total score of every studentn); printf(6.Sort in ascend

4、ing order by numbern); printf(7.Search by numbern); printf(8.Statistic analysis for every coursen); printf(9.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,m); printf(Please enter your choice:n); b

5、reak; case 2: /计算每门课程总分和平均分 Totalave (score,n,m); printf(Please enter your choice:n); break; case 3: /计算每个学生总分和平均分 evestuTotalave (score,n,m,num); break; case 4: /按每个学生总分由高到低排出名次表 Scoredes (num,score,n,m); printf(Please enter your choice:n); break; case 5: /按每个学生总分由低到高排出名次表 Scoreas (num,score,n,m);

6、printf(Please enter your choice:n); break; case 6: /按学号由小到大排出名次表 Numas (num,score,n,m); printf(Please enter your choice:n); break; case 7: /按学号查询学生排名及其各科成绩 printf(请输入查找学号n); scanf(%d,&x); Search (num,score,n,x,m); printf(Please enter your choice:n); break; case 8: /成绩分析 所占比例 statistis (num,score,n,m

7、); printf(Please enter your choice:n); break; case 9: /所有输出 List (num,score,n,m); Totalave (score,n,m); printf(Please enter your choice:n); break; case 0: exit(0); return 0;void Input (long num,int scoreM,int n,int m) /1 int i,j; for(i=0;in;i+) printf(Input students ID and score); scanf(%ld,&numi);

8、for(j=0;jm;j+) scanf(%d,&scoreij); void Totalave (int scoreM,int n,int m) /2.计算每门课程总分和平均分 int i,j,sumM; double aveM; for(j=0;jm;j+) sumj=0; for(i=0;in;i+) sumj=sumj+scoreij; avej=(double)sumj/n; for(i=0;im;i+) printf(科目%d总分=%d,课程平均分=%fn,i+1,sumi,avei);void evestuTotalave (int scoreM,int n,int m,long

9、 num) /3.计算每个学生总分和平均分 int i,j,sumN; double aveN; for(i=0;in;i+) sumi=0; for(j=0;jm;j+) sumi=sumi+scoreij; avei=(double)sumi/m; for(i=0;in;i+) printf(学号为%ld总分=%d,其平均分=%fn,numi,sumi,avei);void Scoredes (long num,int scoreM,int n,int m) /4.按每个学生总分由高到低排出名次表 int i,j,k,t,h,sumN; for(i=0;in;i+) sumi=0; for

10、(j=0;jm;j+) sumi=sumi+scoreij; for(i=0;in;i+) k=i; for(j=i+1;jsumk) k=j; if(i!=k) t=sumk,h=numk; sumk=sumi,numk=numi; sumi=t,numi=h; for(i=0;in;i+) printf(ID:%10ld,score:%dn,numi,sumi);/以长整形打印用%ldvoid Scoreas (long num,int scoreM,int n,int m) /5.按每个学生总分由di到gao排出名次表 int i,j,k,t,h,sumN; for(i=0;in;i+)

11、 sumi=0; for(j=0;jm;j+) sumi=sumi+scoreij; for(i=0;in;i+) k=i; for(j=i+1;jn;j+) if (sumjsumk) k=j; if(i!=k) t=sumk,h=numk; sumk=sumi,numk=numi; sumi=t,numi=h; for(i=0;in;i+) printf(ID:%10ld,score:%dn,numi,sumi);/以长整形打印用%ldvoid Numas (long num,int scoreM,int n,int m) /6.按学号由小到大排出名次表 int i,j,k,tM,h,l;

12、 for(i=0;in;i+) k=i; for(j=i+1;jn;j+) if (numjnumk) k=j; if(i!=k) h=numk; numk=numi; numi=h; for(l=0;lm;l+) tl=scorekl; scorekl=scoreil; scoreil=tl; for(i=0;in;i+) printf(ID:%10ldn,numi);/以长整形打印用%ld for(j=0;jm;j+) printf(project %d score:%dn,j+1,scoreij); void Search (long num,int scoreM,int n,int x

13、,int m) /7.按学号查询学生排名及其各科成绩 int high=n-1,low=0,mid,c=1,pos,o,find=0,i,j,k,tM,h,sumN,l; for(i=0;in;i+) sumi=0; for(j=0;jm;j+) sumi=sumi+scoreij; for(i=0;in;i+) k=i; for(j=i+1;jn;j+) if (numjnumk) k=j; if(i!=k) h=numk,o=sumk; numk=numi,sumk=sumi; numi=h,sumi=o; for(l=0;lm;l+) tl=scorekl; scorekl=scorei

14、l; scoreil=tl; 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;isumpos) c+; printf(ID:%10ldn,numpos);/以长整形打印用%ld for(j=0;jm;j+) printf(project %d score:%dn,j+1,scoreposj); printf(all score:%d,order:%dn,sumpos,c); void s

15、tatistis (long num,int scoreM,int n,int m) /8. int a=0,b=0,c=0,d=0,e=0,i,j; double A,B,C,D,E; for(j=0;jm;j+) for(i=0;i=90) a+; else if(scoreij=80) b+; else if(scoreij=70) c+; else if(scoreij=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*10

16、0; printf(project %dn,j+1); 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 scoreM,int n,int m) int i,j,sumN; double aveN; for(i=0;in;i+) sumi=0; for(j=0;jm;j+) sumi=sumi+scoreij; avei=(double)sumi/m; for(i=0;in;i+) printf(ID:%10ldn,numi); for(j=0;jm;j+) printf(score:%dn,scoreij); printf(总分=%dn平均分%fn,sumi,avei);

展开阅读全文
部分上传会员的收益排行 01、路***(¥15400+),02、曲****(¥15300+),
03、wei****016(¥13200+),04、大***流(¥12600+),
05、Fis****915(¥4200+),06、h****i(¥4100+),
07、Q**(¥3400+),08、自******点(¥2400+),
09、h*****x(¥1400+),10、c****e(¥1100+),
11、be*****ha(¥800+),12、13********8(¥800+)。
相似文档                                   自信AI助手自信AI助手
搜索标签

当前位置:首页 > 教育专区 > 其他

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        获赠5币

©2010-2024 宁波自信网络信息技术有限公司  版权所有

客服电话:4008-655-100  投诉/维权电话:4009-655-100

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :gzh.png    weibo.png    LOFTER.png 

客服