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

运动员信息包括:运动员编号、班级、姓名、竞技项目等。试设计一运动会管理系统,使之能提供以下功能:运动员信息录入功能(运动员信息用文件保存)——输入运动员信息浏览功能——输... 运动员信息包括:运动员编号、班级、姓名、竞技项目等。试设计一运动会管理系统,使之能提供以下功能:
运动员信息录入功能(运动员信息用文件保存)——输入
运动员信息浏览功能——输出
查询和排序功能:(至少一种查询方式)——算法
按竞技项目查询
按姓名查询
运动员信息删除、修改功能(人选项)
需要算法,流程图,总结!
展开
 我来答
匆匆而走过
2010-07-13
知道答主
回答量:15
采纳率:0%
帮助的人:0
展开全部
搞诉我地址,我可以发给你
试试这个,论文也有
#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");
}
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式