《学生成绩管理系统V20资料讲解.docx》由会员分享,可在线阅读,更多相关《学生成绩管理系统V20资料讲解.docx(4页珍藏版)》请在第一文库网上搜索。
1、#inc1ude#inc1ude#inc1udeitmain()(inta,b,d,e,n1z;f1oatc=0,g;pritf(1nputstudentnumber(n30)n);scaf(,%dn);1ongvn,f;f1oatvcn;next:;intx1=0,x2=0,x3=0,4=0,x5=0,x6=0;intz1=60,z2=691z3=70,z4=79,z5=80,z6=89,z7=90,z8=99iz9=100;printf(ManagementforStudentsscoresn,1.Inputrecordn,2.Cacu1atetota1andaveragescoreofc
2、oursen3.Sortindescendingorderbyscoren4.Sortinascendingorderbyscoren,5.Sortinascendingorderbynumbern6.Searchbynumbern,7.Statisticana1ysis8.1istrecordn,O.ExitP1easeInputyourchoicen);scaf(%da);switch(a)(printf(,1nputstudentsIDandscoren);for(b=0;bn;b+)(scanf(%1d%f,&vb,&vcb);)break;for(b=0;bn;b+)(c=c+vcb
3、;)pritf(sum=%.0f,aver=%.2n,c,c);break;printf(Sortindescendingorderbyscoren);for(d=0;dn;d+)(for(e=d+1;en;e+)(if(vcdvce)(g=vcd;vcd=vce;vce=g;g=vd;vd=ve;ve=g;)for(b=0;bn;b+)(printf(%1dt%.OAn,vb,vcb);)break;printf(SortinascendingorderbyscoreAn);for(d=0;dn;d+)(for(e=d+1;evce)(g=vcd;vcd=vce;vce=g;g=vd;vd=
4、ve;ve=g;)for(b=0;bn;b+)(printf(1dt%.On,vb,vcb);)break;pritf(,Sortinascendingorderbynumbern);for(d=0jdnjd+)(for(e=d+1;eve)(g=vcd;vcd=vce;vce=g;g=vd;vd=ve;ve=g;)for(b=0;bn;b+)(printf(%1dt%.On,vb1vcb);)break;pritf(1nputthenumberyouwanttosearchn);scanf(%1df);z=0;for(b=0;bn;b+)(if(vb=f)(printf(%1dt%.On,v
5、b1vcb);z=1;break;)if(z=0)printf(Notfound!n);break;for(b=0;bn;b+)(if(vcb60)x1+;e1seif(vcb70)x2+;e1seif(vcb80)x3+;e1seif(vcb90)x4+;e1seif(vcb100)x5+;e1se6+;)pritf(60t%dt%.2n,x11(f1oat)x1n*100);printf(%d-%dtdt%.2n,z1,z21x2,(f1oat)x2n*100);printf(%d-%dt%dt%.2n,z3,z41x3,(f1oat)x3n*100);pritf(,%d-%dt%dt%.
6、2n,1z5,z61x4,(f1oat)x4n*100);printf(%d-%dWt%.2n1z7,z8,x5,(f1oat)x5n*100);printf(dt%dt.2f%n1z9,6,(f1oat)x6n*100);break;for(d=0;dn;d+)(for(e=d+1;eve)(g=vcd;vcd=vce;vce=g;g=vd;vd=ve;ve=g;)for(b=0;bn;b+)printf(%1dt%.On,vb,vcb);)break;caseO:printf(Edofprogram!n);gotoend;defau1t:pritf(1nputerror!n);)gotonext;end:;)