运动会管理系统源代码
运动会管理系统源代码include#include#includestruct student /* 定义链表 */{long num;char name[10];char danwei[10];int xiangmu;int chengji;struct student *next;};struct student *creat(struct student *h); /*s 输入函数 */struct student *findstudent(struct student *h); /* 查找函数 */struct student *sort(struct student *h); /* 排序函数 */main(){int b,c=1;struct student *head,*p,*f; /* 定义表头指针 */head=NULL; /* 创建一个空表 */printf("\t\t\t**********************\n");printf("\t\t\t****运动会管理系统****\t\t\n");printf("\t\t\t**********************\n");do /* 循环使用系统中的功能 */{printf("*************************************************************************\n");printf("\t\t请输入1或2或3进行功能选择\n"); printf("\t\t输入1---------------------进行输入功能\n"); printf("\t\t输入2---------------------进行查找功能\n"); printf("\t\t输入3---------------------进行排序功能\n");printf("*************************************************************************\n"); scanf("%d",&b); switch(b) /* 进入函数 */ {case 1:head=creat(head);break; case 2:p=findstudent(head);break; case 3:f=sort(head);break; default:printf("输入错误,请从新输入");}printf("*************************************************************************\n");printf("否进行其他功能?\n");printf("是输入------1,否输入------2:\n");scanf("%d",&c);}while(c==1);}/* 输入功能 */struct student *creat(struct student *h){struct student *p1,*p2; /* 定义链表指针 */p1=p2=(struct student*)malloc(sizeof(struct student)); /* 申请新结点 */printf("\n-------------------------------------------------------\n");printf("请依次输入运动员的号码、姓名、单位、项目(run为1,jump为2,swim为3)、成绩\n学号输入0时,结束输入!\n");printf("\n-------------------------------------------------------\n");if(p2!=NULL) printf("请输入号码:");scanf("%ld",&p2->num); /* 输入结点