电脑桌面
添加小米粒文库到电脑桌面
安装后可以在桌面快捷访问

C语言编程火车订票系统源代码

C语言编程火车订票系统源代码_第1页
1/12
C语言编程火车订票系统源代码_第2页
2/12
C语言编程火车订票系统源代码_第3页
3/12
火车订票系统源码 #include #include #include #include int shoudsave=0 ; int count1=0,count2=0,mark=0,mark1=0 ; /*定义存储火车信息的结构体*/ struct train { char num[10];/*列车号*/ char city[10];/*目的城市*/ char takeoffTime[10];/*发车时间*/ char receiveTime[10];/*到达时间*/ int price;/*票价*/ int bookNum ;/*票数*/ }; /*订票人的信息*/ struct man { char num[10];/*ID*/ char name[10];/*姓名*/ int bookNum ;/*需求的票数*/ }; /*定义火车信息链表的结点结构*/ typedef struct node { struct train data ; struct node * next ; }Node,*Link ; /*定义订票人链表的结点结构*/ typedef struct people { struct man data ; struct people*next ; }bookMan,*bookManLink ; /* 初始界面*/ void printInterface() { puts("********************************************************"); puts("* Welcome to use the system of booking tickets *"); puts("********************************************************"); puts("* You can choose the operation: *"); puts("* 1:Insert a train information *"); puts("* 2:Inquire a train information *"); puts("* 3:Book a train ticket *"); puts("* 4:Update the train information *"); puts("* 5:Advice to you about the train *"); puts("* 6:save information to file *"); puts("* 7:quit the system *"); puts("********************************************************"); } /*添加一个火车信息*/ void InsertTraininfo(Link linkhead) { struct node *p,*r,*s ; char num[10]; r = linkhead ; s = linkhead->next ; while(r->next!=NULL) r=r->next ; while(1) { printf("please input the number of the train(0-return)"); scanf("%s",num); if(strcmp(num,"0")==0) break ; /*判断是否已经存在*/ while(s) { if(strcmp(s->data.num,num)==0) { printf("the train '%s'has been born!\n",num); return ; } s = s->next ; } p = (struct node*)malloc(sizeof(struct node)); strcpy(p->data.num,num...

1、当您付费下载文档后,您只拥有了使用权限,并不意味着购买了版权,文档只能用于自身使用,不得用于其他商业用途(如 [转卖]进行直接盈利或[编辑后售卖]进行间接盈利)。
2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。
3、如文档内容存在违规,或者侵犯商业秘密、侵犯著作权等,请点击“违规举报”。

碎片内容

C语言编程火车订票系统源代码

确认删除?
VIP
微信客服
  • 扫码咨询
会员Q群
  • 会员专属群点击这里加入QQ群
客服邮箱
回到顶部