《C语言程序-火车站售票系统程序》由会员分享,可在线阅读,更多相关《C语言程序-火车站售票系统程序(11页珍藏版)》请在人人文库网上搜索。
1、实用标准火车站售票查询系统:#include #include #include #include int shoudsave=0 ;int count1=0,count2=0,mark=0,mark1=0 ;/*定义存储火车信息的结构体*/struct trainchar num10;/* 列车号 */char city10;/* 目的城市 */char takeoffTime10;/*发车时间 */char receiveTime10;/*到达时间 */int price;/* 票价*/int bookNum ;/* 票数 */;/*订票人的信息*/ struct manchar num1。
2、0;/*ID*/char name10;/* 姓名 */int bookNum ;/* 需求的票数*/;/*定义火车信息链表的结点结构*/ typedef struct nodestruct train data ;struct node * next ;Node,*Link ;/*定义订票人链表的结点结构*/typedef struct peoplestruct man data ;struct people*next ;bookMan,*bookManLink ;/*初始界面*/ void printInterface()文档puts(I*”);puts(“*Welcome to use 。
3、the system of booking tickets);puts(I*”);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 fil。
4、e*);puts(*7:quit the system*);puts(*);/*添加一个火车信息*/void In sertTra inin fo(L ink lin khead)struct node *p,*r,*s ;char num10;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 ;/*判断是否已经存在*/w。
5、hile(s)if(strcmp(s-data.num,num)=0)printf(the train %shas been born!n,num); return ;s = s-next ;p = (struct n