c语言运动会成绩管理程序内容摘要:

ofstream outfile1(c:\\运动会分数总分表 .txt,ios::out)。 if(! outfile1) { cerropen error!endl。 } 11 outfile1编号 学校名称 总分 男子总分 女子总分 \nendl。 for(i=1。 i=n。 i++)//i=sch[i] outfile1sch[i].numsetw(8)sch[i].namesetw(12)sch[i].score setw(12)sch[i].malesetw(12)sch[i].femaleendl。 ()。 } void print(int i) { coutsch[i].numsetw(13)sch[i].namesetw(8)sch[i].scoresetw(9) sch[i].malesetw(10)sch[i].femaleendl。 } //按编号排序 void bianhao() { int i,j。 school t。 for(i=1。 in。 i++) { for(j=i。 j=n。 j++) if(sch[i].numsch[j].num) { t=sch[i]。 sch[i]=sch[j]。 sch[j]=t。 } } printf(\n 按编号排列 :\n)。 printf(编号 学校名称 总分 男子总分 女子总分 \n)。 for(i=1。 i=n。 i++) print(i)。 } //总分函数 void zongfentongji() //按学校总分排序 { int i,j。 school t。 for(i=1。 in。 i++) { for(j=i。 j=n。 j++) if(sch[i].scoresch[j].score) { t=sch[i]。 sch[i]=sch[j]。 sch[j]=t。 12 } } printf(\n 按学校总分排列 :\n)。 printf(编号 学校名称 总分 男子总分 女子总分 \n)。 for(i=1。 i=n。 i++) coutsch[i].numsetw(13)sch[i].namesetw(8)sch[i].scoresetw(9) sch[i].malesetw(10)sch[i].femaleendl。 } //按学校男总分排序 void malezongfen() { int i,j。 school t。 for(i=1。 in。 i++) { for(j=i。 j=n。 j++) if(sch[i].malesch[j].male) { t=sch[i]。 sch[i]=sch[j]。 sch[j]=t。 } } printf(\n 按学校男子总分排列 :\n)。 printf(编号 学校名称 总分 男子总分 女子总分 \n)。 for(i=1。 i=n。 i++) print(i)。 ofstream outfile1(c:\\运动会男子总分排序表 .txt,ios::out)。 if(! outfile1) { cerropen error!endl。 } outfile1编号 学校名称 总分 男子总分 女子总分 \nendl。 for(i=1。 i=n。 i++)//i=sch[i] outfile1sch[i].numsetw(8)sch[i].namesetw(12)sch[i].score setw(12)sch[i].malesetw(12)sch[i].femaleendl。 ()。 } //按学校女总分排序 void femalezongfen() { int i,j。 school t。 13 for(i=1。 in。 i++) { for(j=i。 j=n。 j++) if(sch[i].femalesch[j].female) { t=sch[i]。 sch[i]=sch[j]。 sch[j]=t。 } } printf(\n 按学校女子总分排列 :\n)。 printf(\n 编号 学校名称 总分 男子总分 女子总分 \n)。 for(i=1。 i=n。 i++) print(i)。 printf(\n)。 ofstream outfile1(c:\\运动会女子总分排序表 .txt,ios::out)。 if(! outfile1) { cerropen error!endl。 } outfile1编号 学校名称 总分 男子总分 女子总分 \nendl。 for(i=1。 i=n。 i++)//i=sch[i] outfile1sch[i].numsetw(8)sch[i].namesetw(12)sch[i].score setw(12)sch[i].malesetw(12)sch[i].femaleendl。 ()。 } //查询学校信息 void chaxunsch() { int i,y,s。 printf(输入需要查询的学校编号 :\n)。 y=0。 while(1) { scanf(%d,amp。 s)。 if(s=1amp。 amp。 s=n) y=1。 if(y) break。 else printf(输入数据有误,请重新 输入 :)。 } printf(该学校相关信息 :\n)。 printf(\n 编号 学校名称 总分 男子总分 女子总分 \n)。 14 for(i=1。 i=n。 i++) { if(sch[i].num==s) { print(i)。 break。 } } coutendl。 } //查询项目信息 void chaxunxiangmu() { int i,y,s。 printf(输入需要查询的项目编号 :\n)。 y=0。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。