运动会项目管理系统源程序.doc

  1. 1、本文档共13页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
运动会项目管理系统源程序

PAGE         PAGE 1      运动会项目管理系统源程序代码   #includestdio.h    #includestdlib.h    #includeconio.h    #includestring.h  struct date //比赛日期结构体  {  int year;   int month;    int day;   };   struct item //定义节点  {     int number; //编号   char name[10]; //名称    char leibie[10]; //类别   struct date time; //比赛时间    struct item *next; //下一个节点   };   #define len sizeof(struct item) //宏定义  star()//星函数  {     printf(\t\t***************************************\n);   }   struct item *insert(struct item *head,int addnum) //定义插入节点函数  {    struct item *p0,*p1,*p2;    p1=head;   p0=(struct item *)malloc(len); //申请节点  p0-number=addnum; //将要增加的项目编号复制给p0-number  printf(名称:);    scanf(%s,p0-name );   printf(类别:);    scanf(%s,p0-leibie );    printf(日期(年.月.日):);   scanf(%d.%d.%d,p0-time.year,p0-time.month,p0-time.day);  printf(\n);   if (head==NULL) //链表为空表时插入头节点    {  head=p0;    p0-next=NULL;    }  while(p1-numberp0-numberp1-next !=NULL) //查找插入位置   {    p2=p1;   p1=p1-next;    }  if(p0-numberp1-number)   {  if(p1==head) //头节点插入  {   head=p0;  p0-next=p1;   }  else //中间节点插入  {  p2-next=p0;     p0-next=p1;   }    }  else //尾节点插入   {  p1-next=p0;   p0-next =NULL;    }    getchar();    printf(增加项目信息成功!\n);   return head;  }      struct item *creat() //定义创建链表函数   {  struct item *head,*p1,*p2;  int n=0; //定义节点数   p1=(struct item*)malloc(len); //给头结点分别配内存  printf(请输入项目信息!项目编号为0时退出!\n);    printf(编号:);   scanf(%d,p1-number);  head=NULL;   while(p1-number !=0) //节点的编号不为0  {   printf(名称:);  scanf(%s,p1-name);    printf(类别:);   scanf(%s,p1-leibie);  printf(比赛时间(年.月.日):);  scanf(%d.%d.%d,p1-time.year,p1-time.month,p1-time.day);  n=n+1;   if(n==1) //第一个节点   {    head=p1;   p2=head;    }    else  p2-next=p1; //插入节点  p2=p1;   p1=(struct item*)mal

文档评论(0)

小教资源库 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档