| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 675 人关注过本帖
标题:大家看看这个运动会管理程序,我不知道这程序到底有哪些功能,望赐教
只看楼主 加入收藏
c的fans
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2007-5-3
收藏
 问题点数:0 回复次数:0 
大家看看这个运动会管理程序,我不知道这程序到底有哪些功能,望赐教

#include "stdio.h"
#include "string.h"
#define LIST_INIT_SIZE 100
#define LISTINCREMENT 10
#define OK 1
#define ERROR 0
#define OVERFLOW 0
#define NULL 0
typedef int ElemType;

typedef struct xuexiaoshuju{
int tuantiscore;
int manscore;
int womanscore;
int schoolhao;
char school[20];
struct xuexiaoshuju *next;}xuexiaoshuju,*xuexiaoziliao;


typedef struct chengjishuju{
char name[10];
int schoolhao;
int xiangmuhao;
int mingci;
int chengji;
struct chengjishuju *next;}chengjishuju,*chengjiziliao;


typedef struct xiangmushuju{
int xiangmuhao;
char xiangmu[20];
int chengjiyouxiao;
char sex[10];
int sexhao;
struct xiangmushuju *next;}xiangmushuju,*xiangmuziliao;

xuexiaoziliao shuruxuexiao(xuexiaoziliao L,int n)
{ char a;
int i,j;
xuexiaoziliao p,q;
L=(xuexiaoziliao)malloc(sizeof(xuexiaoshuju));
L->next=NULL;
q=L;
for(i=0;i<n;i++)
{j=0;
p=(xuexiaoziliao)malloc(sizeof(xuexiaoshuju));
printf("please input the name of the school!!");
scanf("%c",&a);
while(a=='\n')
scanf("%c",&a);
while(a!='\n')
{
p->school[j]=a;
scanf("%c",&a);
j++;
}
p->school[j]='\0';
p->schoolhao=(i+1);
p->manscore=0;
p->womanscore=0;
p->tuantiscore=0;
q->next=p;
q=p;
q->next=NULL;
}
return L;
}

xiangmuziliao shuruxiangmu(xiangmuziliao L,int n,int m)
{ char a;
int i,j,b;
xiangmuziliao p,q;
L=(xiangmuziliao)malloc(sizeof(xiangmushuju));
L->next=NULL;
q=L;
for(i=0;i<n;i++)
{j=0;
p=(xiangmuziliao)malloc(sizeof(xiangmushuju));
printf("please input the name of the nanzixiangmu!!");
scanf("%c",&a);
while(a=='\n')
scanf("%c",&a);
while(a!='\n')
{
p->xiangmu[j]=a;
scanf("%c",&a);
j++;
}
p->xiangmu[j]='\0';
p->xiangmuhao=(i+1);
printf("please input qu qian ji ming!!");
scanf("%d",&b);
p->chengjiyouxiao=b;
strcpy(p->sex,"man");
p->sexhao=1;
q->next=p;
q=p;
q->next=NULL;
}
for(i=0;i<m;i++)
{j=0;
p=(xiangmuziliao)malloc(sizeof(xiangmushuju));
printf("please input the name of the nvzixiangmu!!");
scanf("%c",&a);
while(a=='\n')
scanf("%c",&a);
while(a!='\n')
{
p->xiangmu[j]=a;
scanf("%c",&a);
j++;
}
p->xiangmu[j]='\0';
p->xiangmuhao=(n+i+1);
printf("please input qu qian ji ming!!");
scanf("%d",&b);
p->chengjiyouxiao=b;
strcpy(p->sex,"woman");
p->sexhao=2;
q->next=p;
q=p;
q->next=NULL;
}
return L;
}


void xuexiaoziliaoTraverse(xuexiaoziliao L)
{xuexiaoziliao h;
h=L->next;
printf("xuexiaoziliao:\nschoolhao school tuantiscore manscore womanscore\n");
while(h!=NULL){printf("%2d ",h->schoolhao);
printf("%-14s",h->school);
printf(" %-11d",h->tuantiscore);
printf(" %-8d",h->manscore);
printf(" %-10d\n",h->womanscore);
h=h->next;
}
}


void xiangmuziliaoTraverse(xiangmuziliao L)
{xiangmuziliao p;
p=L->next;
printf("xiangmuziliao:\nxiangmuhao xiangmu sex chengjiyouxiao\n");
while(p!=NULL){printf("%2d ",p->xiangmuhao);
printf(" %-18s",p->xiangmu);
printf("%-10s",p->sex);
printf("qian %2d\n",p->chengjiyouxiao);
p=p->next;
}
}

chengjiziliao chengjishuru(chengjiziliao N,xuexiaoziliao L, xiangmuziliao M)
{int a,b,i,j,d,e;
char c;
xiangmuziliao p;
xuexiaoziliao t;
chengjiziliao q,r,s;
q=N;
p=M->next;
t=L->next;
printf("please input the xiangmuhao!!");
scanf("%d",&a);
while(p->xiangmuhao!=a)
p=p->next;
b=p->chengjiyouxiao;
for(i=0;i<b;i++)
{j=0;
r=(chengjiziliao)malloc(sizeof(chengjishuju));
printf("please input the name of yundongyuan!!");
scanf("%c",&c);
while(c=='\n')
scanf("%c",&c);
while(c!='\n')
{
r->name[j]=c;
scanf("%c",&c);
j++;
}
r->name[j]='\0';
r->mingci=i+1;
if(b==3)
{switch(i)
{case 0:d=5;break;
case 1:d=3;break;
case 2:d=2;break;
}
}

else if(b==5)
{switch(i)
{case 0:d=7;break;
case 1:d=5;break;
case 2:d=3;break;
case 3:d=2;break;
case 4:d=1;break;
}
}
r->chengji=d;
printf("please input the schoolhao!!");
scanf("%d",&e);
r->schoolhao=e;
r->xiangmuhao=a;
while(t->schoolhao!=e)
t=t->next;
if(p->sexhao==1)
t->manscore=t->manscore+d;
else if(p->sexhao==2)
t->womanscore=t->womanscore+d;
t->tuantiscore=t->tuantiscore+d;
while(q->schoolhao<=e)
{s=q;
q=q->next;}
if(q)
{s->next=r;
r->next=q;}
if(!q)
{s->next=r;
r->next=NULL;}


q=N;
t=L->next;}

return(N);
}


void shuchu(chengjiziliao N,xuexiaoziliao L,xiangmuziliao M)
{chengjiziliao q;
xuexiaoziliao p;
xiangmuziliao t;
q=N->next;
p=L->next;
t=M->next;
printf("chengjibiao:\n");
printf("schoolhao school xiangmu sex mingci name chengji \n");
while(q!=NULL)
{printf(" %2d ",q->schoolhao);
while(q->schoolhao!=p->schoolhao)
p=p->next;
printf(" %-12s",p->school);
while(q->xiangmuhao!=t->xiangmuhao)
t=t->next;
printf("%-10s",t->xiangmu);
printf("%-7s",t->sex);
printf("%2d ",q->mingci);
printf(" %-10s",q->name);
printf("%2d\n",q->chengji);
q=q->next;
p=L->next;
t=M->next;
}

}

main()
{int n,m,w,i,j;
chengjiziliao N;
char a;
xuexiaoziliao L;
chengjiziliao M;
N=(chengjiziliao)malloc(sizeof(chengjishuju));
N->schoolhao=0;
N->next=NULL;
printf("please input the number of the school!!\n");
scanf("%d",&n);
L=shuruxuexiao(L,n);
clrscr();
printf("please input the number of the nanzixiangmu!!\n");
scanf("%d",&m);
printf("please input the number of the nvzixiangmu!!\n");
scanf("%d",&w);
M=shuruxiangmu(M,m,w);
clrscr();
xuexiaoziliaoTraverse(L);
xiangmuziliaoTraverse(M);
i=m+w;
for(j=0;j<i;j++){
N=chengjishuru(N,L,M);
clrscr();
xiangmuziliaoTraverse(M);

}
printf("game over!!\nplease press anykey shuchu tuanti chengjibiao!!");
getch();
clrscr();
xuexiaoziliaoTraverse(L);
printf("please press anykey shuchu jutichengjibiao!!");
getch();
clrscr();
shuchu(N,L,M);
printf("please press anykey overthe program!!");
getch();


}

搜索更多相关主题的帖子: 管理程序 运动会 
2007-09-04 08:33
快速回复:大家看看这个运动会管理程序,我不知道这程序到底有哪些功能,望赐教
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.025344 second(s), 10 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved