当前位置:首页 » 课程大全 » 运动会的课程设计c

运动会的课程设计c

发布时间: 2021-03-15 01:07:31

❶ C++课程设计:运动会分数统计

main()
{int i,c; /*c为项目编号*/

printf("********************************************************\n");
printf(" C程序语言课程设计------运动会分数统计\n");
printf(" 设计人: 班\n");
printf("********************************************************\n");
printf("请输入参加运动会的学校个数:");
scanf("%d",&n);
printf("\n有多少个男子项目:");
scanf("%d",&m);
printf("\n有多少个女子项目:");
scanf("%d",&w);
printf("\n本次运动会有%d个学校参加,共设%d个比赛项目,其中男子项目%d个,女子项目%d个。\n",n,m+w,m,w);

printf("请输入比赛结果资料\n");
for(i=0;i<m+w;i++)
ma[i].matnum=i+1; /*初始化项目编号*/

c=1; /*初始化c*/
while(c!=0)
{printf("\n请输入已结束的比赛项目编号(0=COTINUE):");
scanf("%d",&c);
if((c>0)&&(c<=m+w))
input?; /*调用输入函数*/
else if(c==0) break;
else printf("\n!error:输入的数应为1-%d之间的整数!\n",m+w); /*输入出错信息*/
}
printf("\nLoading......\n"); /*稍后*/

index(); /*调用整理函数*/
teamsco(); /*调用团体成绩计算函数*/

teamput(); /*调用输出团体报表函数*/

c=1; /*初始化c*/
while(c!=0)
{printf("\n\n请输入学校编号查询成绩列表(0=EXIT):");
scanf("%d",&c);
if(c==0) break;
else if((c>=0)&&(c<=m+w))
output?; /*调用输出学校成绩列表函数*/
else printf("\n!error:输入的数应为1-%d之间的整数!\n",m+w); /*输入出错信息*/
}
system("cls");/*清屏函数*/ /*这个地方有些问题,我换了一个系统函数*/
printf("\n谢谢!请多多指教!\n");
getch();
exit(1);/*如果不用这条可能出现问题*/
return;}

❷ 一个较为典型的c语言课程设计题目:校际运动会管理系统

include "stdio.h" /*I/O函数*/
#include "stdlib.h" /*其它说明*/
#include "string.h" /*字符串函数*/
#include "conio.h" /*屏幕操作函数*/
#include "mem.h" /*内存操作函数*/
#include "ctype.h" /*字符操作函数*/
#include "alloc.h" /*动态地址分配函数*/
struct score
{
int mingci;
char xuehao[8];
char mingzi[20];
float score[6];
}data,info[1000];
int i,j,k=0;
char temp[20],ch;
FILE *fp,*fp1;

void shuru()
{
if((fp=fopen("s_score.txt","ab+"))==NULL)
{
printf("cannot open this file.\n");
getch();exit(0);
}
for(i=0;i<=1000;i++)
{
printf("\nPlease shuru xuehao:");
gets(data.xuehao);
printf("Please shuru mingzi:");
gets(data.mingzi);
printf("Please shuru yuwen score:");
gets(temp);data.score[0]=atof(temp);
printf("Please shuru shuxue score:");
gets(temp);data.score[1]=atof(temp);
printf("Please input yingyu score:");
gets(temp);data.score[2]=atof(temp);
printf("Please shuru wuli score:");
gets(temp);data.score[3]=atof(temp);
printf("Please shur huaxue score:");
gets(temp);data.score[4]=atof(temp);
data.score[5]=data.score[0]+data.score[1]+data.score[2]+data.score[3]+data.score[4];
fwrite(&data,sizeof(data),1,fp);
printf("another?y/n");
ch=getch();
if(ch=='n'||ch=='N')
break;
} fclose(fp);
}
void xianshi()
{
float s;int n;
if((fp=fopen("s_score.txt","rb+"))==NULL)
{
printf("Cannot reading this file.\n");
exit(0);
}
for(i=0;i<=1000;i++)
{
if((fread(&info[i],sizeof(info[i]),1,fp))!=1)
break;
}
printf("\nxuehao mingzi yuwen shuxue yingyu wuli huauxue zhongfen\n");
for(j=0,k=1;j<i;j++,k++)
{
info[j].mingci=k;
printf("%6s %8s %3.1f %3.1f %3.1f %3.1f %3.1f %3.1f\n",info[j].xuehao,info[j].mingzi,info[j].score[0],info[j].score[1],info[j].score[2],info[j].score[3],info[j].score[4],
info[j].score[5]);
}
getch();
fclose(fp);
}

void xiugai()
{
if((fp=fopen("s_score.txt","rb+"))==NULL||(fp1=fopen("temp.txt","wb+"))==NULL)
{
printf("Cannot open this file.\n");
exit(0);
}
printf("\nPLease shuru xiugai xuehao:");
scanf("%d",&i); getchar();
while((fread(&data,sizeof(data),1,fp))==1)
{
j=atoi(data.xuehao);
if(j==i)
{
printf("xuehao:%s\nmingzi:%s\n",data.xuehao,data.mingzi);
printf("Please shuru mingzi:");
gets(data.mingzi);
printf("Please shuru yuwen score:");
gets(temp);data.score[0]=atof(temp);
printf("Please shuru shuxue score:");
gets(temp);data.score[1]=atof(temp);
printf("Please input yingyu score:");
gets(temp);data.score[2]=atof(temp);
printf("Please input wuli score:");
gets(temp);data.score[3]=atof(temp);
printf("Please input huaxue score:");
gets(temp);data.score[4]=atof(temp);
data.score[5]=data.score[0]+data.score[1]+data.score[2]+data.score[3]+data.score[4];

} fwrite(&data,sizeof(data),1,fp1);
}
fseek(fp,0L,0);
fseek(fp1,0L,0);
while((fread(&data,sizeof(data),1,fp1))==1)
{
fwrite(&data,sizeof(data),1,fp);
}

fclose(fp);
fclose(fp1);
}
void chazhao()
{
if((fp=fopen("s_score.txt","rb"))==NULL)
{
printf("\nCannot open this file.\n");
exit(0);
}
printf("\nPLease shuru xuehao chakan:");
scanf("%d",&i);
while(fread(&data,sizeof(data),1,fp)==1)
{
j=atoi(data.xuehao);
if(i==j)
{
printf("xuehao:%s mingzi:%s\nyuwen:%f\n shuxue:%f\n yingyu:%f\n wuli:%f\n huaxue:%f\n ",data.xuehao,data.mingzi,data.score[0],data.score[1],data.score[2],data.score[3],data.score[4],data.score[5]);
}getch();
}
}
void shanchu()
{
if((fp=fopen("s_score.txt","rb+"))==NULL||(fp1=fopen("temp.txt","wb+"))==NULL)
{
printf("\nopen score.txt was failed!");
getch();
exit(0);
}
printf("\nPlease input ID which you want to del:");
scanf("%d",&i);getchar();
while((fread(&data,sizeof(data),1,fp))==1)
{
j=atoi(data.xuehao);
if(j==i)
{

printf("Anykey will delet it.\n");
getch();
continue;
}
fwrite(&data,sizeof(data),1,fp1);
}
fclose(fp);
fclose(fp1);
remove("s_score.txt");
rename("temp.txt","s_score.txt");
printf("Data delet was succesful!\n");
printf("Anykey will return to main.");
getch();
}
main()
{
while(1)
{
clrscr(); /*清屏幕*/
gotoxy(1,1); /*移动光标*/
textcolor(YELLOW); /*设置文本显示颜色为黄色*/
textbackground(BLUE); /*设置背景颜色为蓝色*/
window(1,1,99,99); /* 制作显示菜单的窗口,大小根据菜单条数设计*/
clrscr();
printf("*************welcome to use student manage******************\n");
printf("*************************menu********************************\n");
printf("* ========================================================= * \n");
printf("* 1>shuru 2>xiugai * \n");
printf("* 3>shanchu 4>chazhao * \n");
printf("* 5>xianshi 6>exit * \n");
printf("* * \n");
printf("* --------------------------------------------------------- * \n");
printf(" Please input which you want(1-6):");
ch=getch();
switch(ch)
{
case '1':shuru();break;
case '2':xiugai(); break;
case '3':shanchu(); break;
case '4':chazhao(); break;
case '5':xianshi(); break;
case '6':exit(0);
default: continue;
}
}

❸ C语言课程设计 运动会学生成绩管理系统 现在下面部分程序中加入 按姓名查找功能,求高手解答

voidselect1(structstudent*p)//按姓名查询
{
intm;
m=N;
chary[10];
printf("请输入学生的姓名是: ");
scanf("%s",y);
for(p=stu;p<stu+m;p++)
{
if(strcmp(p->name,y)==0)//字符串比较函数
{
p->aver=(p->score[0]+p->score[1]+p->score[2])/3;
printf("学号:%s姓名:%s高数:%d大物:%d英语:%d平均分:%f ",p->num,p->name,p->score[0],p->score[1],p->score[2],p->aver);
}
}
}

以前写的回学生成绩管理系统的答。

你适当改一改吧。

❹ c语言课设 运动会成绩管理系统

807712443,qq联系吧

❺ C语言课程设计 运动会学生成绩管理系统 将下面程序添加成绩由高到低,由低到高排名两项功能。

咋不能运行,错了好多

❻ C语言课程设计~~~ 要求编写一段程序,题目是《校际运动会管理系统》

我这是源代码已经调试过了,在VC++上运行成功了。
#include "stdio.h" /*I/O函数*/
#include "stdlib.h" /*其它说明*/
#include "string.h" /*字符串函数*/
#include "conio.h" /*屏幕操作函数*/
#include "mem.h" /*内存操作函数*/
#include "ctype.h" /*字符操作函数*/
#include "alloc.h" /*动态地址分配函数*/
struct score
{
int mingci;
char xuehao[8];
char mingzi[20];
float score[6];
}data,info[1000];
int i,j,k=0;
char temp[20],ch;
FILE *fp,*fp1;

void shuru()
{
if((fp=fopen("s_score.txt","ab+"))==NULL)
{
printf("cannot open this file.\n");
getch();exit(0);
}
for(i=0;i<=1000;i++)
{
printf("\nPlease shuru xuehao:");
gets(data.xuehao);
printf("Please shuru mingzi:");
gets(data.mingzi);
printf("Please shuru yuwen score:");
gets(temp);data.score[0]=atof(temp);
printf("Please shuru shuxue score:");
gets(temp);data.score[1]=atof(temp);
printf("Please input yingyu score:");
gets(temp);data.score[2]=atof(temp);
printf("Please shuru wuli score:");
gets(temp);data.score[3]=atof(temp);
printf("Please shur huaxue score:");
gets(temp);data.score[4]=atof(temp);
data.score[5]=data.score[0]+data.score[1]+data.score[2]+data.score[3]+data.score[4];
fwrite(&data,sizeof(data),1,fp);
printf("another?y/n");
ch=getch();
if(ch=='n'||ch=='N')
break;
} fclose(fp);
}
void xianshi()
{
float s;int n;
if((fp=fopen("s_score.txt","rb+"))==NULL)
{
printf("Cannot reading this file.\n");
exit(0);
}
for(i=0;i<=1000;i++)
{
if((fread(&info[i],sizeof(info[i]),1,fp))!=1)
break;
}
printf("\nxuehao mingzi yuwen shuxue yingyu wuli huauxue zhongfen\n");
for(j=0,k=1;j<i;j++,k++)
{
info[j].mingci=k;
printf("%6s %8s %3.1f %3.1f %3.1f %3.1f %3.1f %3.1f\n",info[j].xuehao,info[j].mingzi,info[j].score[0],info[j].score[1],info[j].score[2],info[j].score[3],info[j].score[4],
info[j].score[5]);
}
getch();
fclose(fp);
}

void xiugai()
{
if((fp=fopen("s_score.txt","rb+"))==NULL||(fp1=fopen("temp.txt","wb+"))==NULL)
{
printf("Cannot open this file.\n");
exit(0);
}
printf("\nPLease shuru xiugai xuehao:");
scanf("%d",&i); getchar();
while((fread(&data,sizeof(data),1,fp))==1)
{
j=atoi(data.xuehao);
if(j==i)
{
printf("xuehao:%s\nmingzi:%s\n",data.xuehao,data.mingzi);
printf("Please shuru mingzi:");
gets(data.mingzi);
printf("Please shuru yuwen score:");
gets(temp);data.score[0]=atof(temp);
printf("Please shuru shuxue score:");
gets(temp);data.score[1]=atof(temp);
printf("Please input yingyu score:");
gets(temp);data.score[2]=atof(temp);
printf("Please input wuli score:");
gets(temp);data.score[3]=atof(temp);
printf("Please input huaxue score:");
gets(temp);data.score[4]=atof(temp);
data.score[5]=data.score[0]+data.score[1]+data.score[2]+data.score[3]+data.score[4];

} fwrite(&data,sizeof(data),1,fp1);
}
fseek(fp,0L,0);
fseek(fp1,0L,0);
while((fread(&data,sizeof(data),1,fp1))==1)
{
fwrite(&data,sizeof(data),1,fp);
}

fclose(fp);
fclose(fp1);
}
void chazhao()
{
if((fp=fopen("s_score.txt","rb"))==NULL)
{
printf("\nCannot open this file.\n");
exit(0);
}
printf("\nPLease shuru xuehao chakan:");
scanf("%d",&i);
while(fread(&data,sizeof(data),1,fp)==1)
{
j=atoi(data.xuehao);
if(i==j)
{
printf("xuehao:%s mingzi:%s\nyuwen:%f\n shuxue:%f\n yingyu:%f\n wuli:%f\n huaxue:%f\n ",data.xuehao,data.mingzi,data.score[0],data.score[1],data.score[2],data.score[3],data.score[4],data.score[5]);
}getch();
}
}
void shanchu()
{
if((fp=fopen("s_score.txt","rb+"))==NULL||(fp1=fopen("temp.txt","wb+"))==NULL)
{
printf("\nopen score.txt was failed!");
getch();
exit(0);
}
printf("\nPlease input ID which you want to del:");
scanf("%d",&i);getchar();
while((fread(&data,sizeof(data),1,fp))==1)
{
j=atoi(data.xuehao);
if(j==i)
{

printf("Anykey will delet it.\n");
getch();
continue;
}
fwrite(&data,sizeof(data),1,fp1);
}
fclose(fp);
fclose(fp1);
remove("s_score.txt");
rename("temp.txt","s_score.txt");
printf("Data delet was succesful!\n");
printf("Anykey will return to main.");
getch();
}
main()
{
while(1)
{
clrscr(); /*清屏幕*/
gotoxy(1,1); /*移动光标*/
textcolor(YELLOW); /*设置文本显示颜色为黄色*/
textbackground(BLUE); /*设置背景颜色为蓝色*/
window(1,1,99,99); /* 制作显示菜单的窗口,大小根据菜单条数设计*/
clrscr();
printf("*************welcome to use student manage******************\n");
printf("*************************menu********************************\n");
printf("* ========================================================= * \n");
printf("* 1>shuru 2>xiugai * \n");
printf("* 3>shanchu 4>chazhao * \n");
printf("* 5>xianshi 6>exit * \n");
printf("* * \n");
printf("* --------------------------------------------------------- * \n");
printf(" Please input which you want(1-6):");
ch=getch();
switch(ch)
{
case '1':shuru();break;
case '2':xiugai(); break;
case '3':shanchu(); break;
case '4':chazhao(); break;
case '5':xianshi(); break;
case '6':exit(0);
default: continue;
}
}

❼ 急求C语言课程设计答案。题目:运动会分数统计

有偿 可联系 看ID

❽ 求C语言课程设计 运动会管理系统

搞诉我地址,我可以发给你
试试这个,论文也有
#include<stdio.h>
#define A 100
int y=0,f=0,j,W,M,N,p[15],q[15];
struct student
{ char shool[20];
char name[20];
char item[20];
char sex;
int position;
int mark;
}stu[A];

struct item
{ char name[20];
char sex;
int mark;
}it[A];

struct shool
{ char name[20];
char item[20];
int mark;
}sho[A];

main()
{
menu();
}

menu()
{ int w1,n;
do
{ puts("\t\t*****************MENU********************");
puts("\n\n\t\t 1.The information to writein\n");
puts("\t\t 2.The race result records to writein\n");
puts("\t\t 3.Search the information\n");
puts("\t\t 4.Exit\n");
puts("\n\t\t*****************************************");
puts("\n\nChoice you number:");
scanf("%d",&n);
if(n<1||n>4){w1=1;getchar();}
else w1=0;
}while(w1==1);
switch(n)
{ case 1:establish();break;
case 2:enter();break;
case 3:search();break;
case 4:exit(0);
}
}

establish()
{ int h,r; extern N,M,W;
y=1;
printf("\nThe number of shool attended is:");
scanf("%d",&N);
printf("\nThe number of men item is:");
scanf("%d",&M);
printf("\nThe number of women item is:");
scanf("%d",&W);
printf("\nThere are three form of marked you can choice:");
printf("\n\n\t1).1th--7,2th--5,3th--3,4th--2,5th--1.");
printf("\n\n\t2).1th--5,2th--3,3th--1.");
printf("\n\n\t3).Define by youself.");
loop: printf("\n\nChoice the number(1--3):");
scanf("%d",&h);
if(h>0&&h<4)
switch(h)
{case 1:j=1;break;
case 2:j=2;break;
case 3:define_mark();
}
else goto loop;
printf("Success!!!\nPress any key+Enter to menu..");scanf("%d",&r);
menu();
}

enter()
{ int t,r,i=0;extern j,y;char F,M;
if(y==0)
{ printf("Please establish system first!!\nPress any key+Enter to menu.. ");
scanf("%d",&r);
menu();
}
do
{
printf("\nPlease enter the student's name:\t");scanf("%s",&stu[i].name);
printf("\nPlease enter the student's shool:\t");scanf("%s",&stu[i].shool);
printf("\nPlease enter the student's item:\t");scanf("%s",&stu[i].item);
loop_1: printf("\nPlease enter the student's sex(W or M):\t");scanf("%s",&stu[i].sex);
if(stu[i].sex!='W'&&stu[i].sex!='M')goto loop_1;
printf("\nPlease enter the student's position:\t");scanf("%d",&stu[i].position);
mark(j,i);
loop_2:printf("\n\nDo again?\t1).Yes\t2).No\t");
scanf("%d",&t);
if(t!=2&&t!=1)goto loop_2;
if(t==2)break;
i++;
}while(t==1);f=1;
printf("Success!!!\nPress any key+Enter to menu..");scanf("%d",&r);
menu();
}

search()
{ int e;char c;extern f;
if(f==0)
{ printf("Please enter the data first!!\nPress any key+Enter to menu..\n ");
scanf("%s",&c);
menu();
}
loop:printf("\nThe form of searching you want to choice:\n\t1).By school\n\t2).Bt item\n\t3).To menu\t");
scanf("%d",&e);
switch(e)
{ case 1:search_school();break;
case 2:search_item();break;
case 3:menu();
}
if(e>4||e<1)goto loop;
printf("Press any key+Enter to menu..");scanf("%s",&c);menu();
}

search_school()
{ int x,sum=0,w=0;
struct student s;
printf("\nPlease enter the name of the school that you want to search:");
scanf("%s",&s.shool);
printf_face();
for(x=0;x<A;x++)
if(strcmp(s.shool,stu[x].shool)==0)
{ sum+=stu[x].mark;
printf_one(x);w=1;
}
printf_sum(sum);
if(w==0)
{printf("\n\n*The name is wrong,press again!");search_school();}

}

search_item()
{ int x,sum=0,w=0;
struct student s;
printf("\nPlease enter the name of the item that you want to search:");
scanf("%s",&s.item);
printf_face();
for(x=0;x<A;x++)
if(strcmp(s.item,stu[x].item)==0)
{ sum+=stu[x].mark;
printf_one(x);w=1;
}
printf_sum(sum);
if(w==0)
{ printf("\n\n*The name is wrong,press again!");search_item();}

}
mark(int j,int i)
{ int g; extern p[15],q[15];
if(j==1)
{if(stu[i].position==1)stu[i].mark=7;
else if(stu[i].position==2)stu[i].mark=5;
else if(stu[i].position==3)stu[i].mark=3;
else if(stu[i].position==4)stu[i].mark=2;
else if(stu[i].position==5)stu[i].mark=1;
}
if(j==2)
{ if(stu[i].position==1)stu[i].mark=5;
else if(stu[i].position==2)stu[i].mark=3;
else if(stu[i].position==3)stu[i].mark=1;
}
if(j==3)
{ for(g=0;g<15;g++)if(stu[i].position==p[g])stu[i].mark=q[g];}

}

define_mark()
{ static int p[15],q[15],a,b,j;
for(a=0;a<15;a++)
{ printf("\nThe position(1--15):");scanf("%d",&p[a]);
printf("\nThe mark you want to define(Integral):");scanf("%d",&q[a]);
loop:printf("\nDo you want define more:\t1).Yes\t2).No");scanf("%d",&b);
if(b==2)break;
if(b!=1)goto loop;
}
j=3;
}

printf_one(int x)
{ printf("\n%-20s%-20s%-20s%-5c%-9d%-5d",stu[x].shool,stu[x].name,stu[x].item,stu[x].sex,stu[x].position,stu[x].mark);
}

printf_sum(int sum)
{ printf("\n\nThe sum of mark is:\t %d",sum);
printf("\nThe shool number is: \t%d",N);
printf("\nThe item number is: \t%d\n",W+M);
}
printf_face()
{ printf("\n\nSchool name student name item sex position mark");
}

❾ c语言课程设计。 校际运动会管理系统 一、题目要求 (1)信息初始化 输入:N─参赛

会管理系统 一、题目要求 (1)信息初始化 输入:N─参赛
当然的

❿ C语言课程设计 要求编写一段程序 题目是《运动会分数统计系统》

不错,我会把题弄回家试试的.
你要等我,等我哦,我一定会回来的.
ka~~~
导演,我的二分是不是到手了?
(tt)p
开心一下,有机会大家研究研究.

热点内容
武汉大学学生会辅导员寄语 发布:2021-03-16 21:44:16 浏览:612
七年级学生作文辅导学案 发布:2021-03-16 21:42:09 浏览:1
不屑弟高考成绩 发布:2021-03-16 21:40:59 浏览:754
大学毕业证会有成绩单 发布:2021-03-16 21:40:07 浏览:756
2017信阳学院辅导员招聘名单 发布:2021-03-16 21:40:02 浏览:800
查询重庆2018中考成绩查询 发布:2021-03-16 21:39:58 浏览:21
结业考试成绩怎么查询 发布:2021-03-16 21:28:40 浏览:679
14中医医师资格笔试考试成绩查分 发布:2021-03-16 21:28:39 浏览:655
名著赏析课程标准 发布:2021-03-16 21:27:57 浏览:881
北京大学商业领袖高端培训课程 发布:2021-03-16 21:27:41 浏览:919