航空客运订票系统

航空客运订票系统

ID:8152363

大小:25.72 KB

页数:20页

时间:2018-03-07

航空客运订票系统_第1页
航空客运订票系统_第2页
航空客运订票系统_第3页
航空客运订票系统_第4页
航空客运订票系统_第5页
资源描述:

《航空客运订票系统》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库

1、航空客运订票系统#include#include#include#includetypedefstruct{intmon;intday;inthour;intmint;}Time;typedefstructPassagerinfo{charname[12];charID[20];intseatNo;}Passagerinfo;typedefstructFlightinfo{charcity1[12];charflightnum[10];charpl

2、anenum[10];Timesetout;Timearrive;floatprice;floatdisc;inttotalseat;intleftseat;intleftseat0;//真实的剩余位置(退票之后的)Passagerinfo*Pslist;Flightinfo*next;}Flightinfo;typedefstructPassagerinform{charname[12];charID[20];intseatNo;Flightinfo*flight;}Passagerinform;typedefstruct

3、Destination{charcity[12];Flightinfo*List;Destination*next;}Destination;Flightinfo*insertflight(Flightinfo*head,charcity[12]){Flightinfo*p0,*p1,*p2;p1=head;p0=(Flightinfo*)malloc(sizeof(Flightinfo));printf("航班号:");scanf("%s",&p0->flightnum);if(head==NULL){head=p0;p0

4、->next=NULL;}else{while(strcmp(p0->flightnum,p1->flightnum)!=0&&p1->next!=NULL){p2=p1;p1=p1->next;}if(strcmp(p0->flightnum,p1->flightnum)==0){printf("该航班已存在。");return(head);}else{p1->next=p0;p0->next=NULL;}}strcpy(p0->city1,city);//弥补城市printf("飞机号:");scanf("%s",&

5、p0->planenum);printf("出发时间(月/日/时/分):");scanf("%d/%d/%d/%d",&p0->setout.mon,&p0->setout.day,&p0->setout.hour,&p0->setout.mint);printf("抵达时间(月/日/时/分):");scanf("%d/%d/%d/%d",&p0->arrive.mon,&p0->arrive.day,&p0->arrive.hour,&p0->arrive.mint);printf("票价/元:");scanf("%f",

6、&p0->price);printf("折扣:");scanf("%f",&p0->disc);printf("总位置:");scanf("%d",&p0->totalseat);p0->leftseat=p0->totalseat;p0->leftseat0=p0->totalseat;p0->Pslist=(Passagerinfo*)malloc((p0->totalseat)*sizeof(Passagerinfo));return(head);}intQuitnum=0;Destination*insertdest

7、(Destination*head){Destination*p0,*p1,*p2;p0=(Destination*)malloc(sizeof(Destination));printf("抵达城市:");scanf("%s",&p0->city);p1=head;if(head==NULL){head=p0;p0->List=insertflight(NULL,p0->city);p0->next=NULL;return(head);}else{while(strcmp(p0->city,p1->city)!=0&&p1-

8、>next!=NULL){p2=p1;p1=p1->next;}if(strcmp(p0->city,p1->city)==0){p1->List=insertflight(p1->List,p0->city);}else{p1->next=p0;p0->List=insertflight

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。