c语言大作业学生成绩管理系统.docx
《c语言大作业学生成绩管理系统.docx》由会员分享,可在线阅读,更多相关《c语言大作业学生成绩管理系统.docx(7页珍藏版)》请在冰豆网上搜索。
c语言大作业学生成绩管理系统
tudentID);
scanf("%s",stu[i].studentName);
for(j=0;jscanf("%d",&stu[i].score[j]);
voidTotalave(STUstu[],intn,intm)
算每门课程的总分和平均分
inti,j,sum[M];
doubleave[M];
for(j=0;jsum[j]=0;
for(i=0;isum[j]=sum[j]+stu[i].score[j];
ave[j]=(double)sum[j]/n;
for(i=0;i算每个学生的总分和平均分
printf(”科目%d的总分=%d課程的平均分=%f\n",i+1,sum[i],ave[i]);
voidevestuTotalave(STUstu[],intn,intm)
inti,j,sum[N];
doubleave[N];
for(i=0;isum[i]=0;
for(j=0;jsum[i]=sum[i]+stu[i].score[j];
ave[i]=(double)sum[i]/m;
for(i=0;iprintf("
学号为%ld,姓名为%s的总分=%d,其平均分
=%f\n",stu[i].studentID,stu[i].studentName,sum[i],ave[i]);
voidScoredes(STUstu[],intn,intm)每个学生的总分由高到低排出名次表
inti,j,k,h,sum[N];
STUt;
for(i=0;isum[i]=0;
for(j=0;jsum[i]=sum[i]+stu[i].score[j];
for(i=0;ik=i;
for(j=i+1;jif(sum[j]>sum[k])
k=j;
if(i!
=k)
t=stu[i],h=sum[i];
stu[i]=stu[k],sum[i]=sum[k];
stu[k]=t,sum[k]=h;
for(i=0;i%10ld,name:
%s,score:
%d\n",stu[i].studentID,stu[i].studentName,sum[i]);每个学生的总分由di到gao排出名次表
inti,j,k,h,sum[N];
STUt;
for(i=0;isum[i]=0;
for(j=0;jsum[i]=sum[i]+stu[i].score[j];
for(i=0;ik=i;
for(j=i+1;jif(sum[j]k=j;
if(i!
=k)
t=stu[i],h=sum[i];
stu[i]=stu[k],sum[i]=sum[k];
stu[k]=t,sum[k]=h;
for(i=0;i
printf("ID:
%10ld,name:
%s,score:
%d\n",stu[i].studentID,stu[i].studentName,sum[i]);学号由小到大排出名次表
inti,j,k;
STUt;
for(i=0;ik=i;
for(j=i+1;jif(stu[j].studentIDk=j;
if(i!
=k)
t=stu[k],stu[k]=stu[i],stu[i]=t;
for(i=0;iprintf("ID:
%10ld,name:
%s\n",stu[i].studentID,stu[i].studentName);core[j]);
voidDicas(STUstu[],intn,intm){
inti,j;
STUt;
for(i=0;ifor(j=i+1;jif(strcmp(stu[i].studentName,stu[j].studentName)>0)
t=stu[i],stu[i]=stu[j],stu[j]=t;
for(i=0;iprintf("ID:
%10ld,name:
%s\n",stu[i].studentID,stu[i].studentName);
for(j=0;jprintf("project:
%d,score:
%d\n",j+1,stu[i].score[j]);
voidSearchbynum(STUstu[],intn,intx,intm)
学号查询学生排名及其各科成绩
inti,j,c=1,find=0,sum[N];
for(i=0;isum[i]=0;
for(j=0;jsum[i]=sum[i]+stu[i].score[j];
for(i=0;iif(stu[i].studentID==x)
find=1;
break;
if(find==0)
printf("notfind\n");
else
for(j=0;jif(sum[j]>sum[i])
c++;
printf("ID:
%10ldname:
%s\n",stu[i].studentID,stu[i].studentName);core[j]);
printf("allscore:
%d,order:
%d\n",sum[i],c);
voidSearchbymane(STUstu[],intn,charname[],intm)core[j];
for(i=0;iif(strcmp(stu[i].studentName,name)==0)
{find=1;
break;}
if(find==0)
printf("notfind\n");
else
for(j=0;jif(sum[j]>sum[i])
c++;
printf("ID:
%10ld,name:
%s\n",stu[i].studentID,stu[i].studentName);core[j]);
printf("allscore:
%d,order:
%d\n",sum[i],c);
voidstatistis(STUstu[],intn,intm){
inta=0,b=0,c=0,d=0,e=0,i,j;
doubleA,B,C,D,E;
for(j=0;jfor(i=0;iif(stu[i].score[j]>=90)
a++;
elseif(stu[i].score[j]>=80)
b++;
elseif(stu[i].score[j]>=70)
c++;
elseif(stu[i].score[j]>=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;
prinm-projecfwdwj+u
prinm-
prinm-
prinm-
prinm-
prinm-
wdmv民Vf%%一rreEX
void匚s二STUSfu-Linfn」nf3)宀
in二Lsum-Nr
doub-eave-Nr
for(no=An=++)
sum三Ha
for〒ojA3j++)
sum三Hsum三+sfu三.scoreE
ave三H(doub-e)su3=u3-
for(i=0;iprintf("ID:
%10ld,name:
%s\n",stu[i].studentID,stu[i].studentName);
for(j=0;jprintf("score:
%d\n",stu[i].score[j]);
printf("
总分=%d\n平均分%f\n",sum[i],ave[i]);