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

C版大大数据结构航空订票系统源代码VIP免费

C版大大数据结构航空订票系统源代码_第1页
1/10
C版大大数据结构航空订票系统源代码_第2页
2/10
C版大大数据结构航空订票系统源代码_第3页
3/10
实用标准文案精彩文档#ifndef_FLIGHT_H_#define_FLIGHT_H_#includeusingnamespacestd;structnode{intid;charstart[20];charover[20];floats_time;floato_time;intprice;floatsale;intticket;structnode*next;};structpeople{charname[20];charpasspart[20];intticket;intid;intnumber;structpeople*next;};classfly{public:voidadd();node*read();intselect();voidupdate();voidupdate_ticket(intid,intu_id);ofstreamwe;ifstreamre;private:node*head;};classuser:publicfly实用标准文案精彩文档{public:intadd();intinsert();voiddele();intuser_id;};#endif#include"iostream"#include"flight.h"#include"fstream"usingnamespacestd;voidfly::add(){inti;node*p=newnode;node*s,*n;head=p;we.open("flight.txt",ios_base::app|ios_base::binary);cout<<"请依次输入航班信息:"<>p->id>>p->start>>p->over>>p->s_time>>p->o_time>>p->price>>p->sale>>p->ticket;while(p!=NULL){cout<<"是否再次输入?1是2否"<>i;if(i==1){s=newnode;cin>>s->id>>s->start>>s->over>>s->s_time>>s->o_time>>s->price>>s->sale>>s->ticket;p->next=s;p=s;p->next=NULL;}else{p->next=NULL;p=p->next;}实用标准文案精彩文档}n=head;while(n!=NULL){we.write(reinterpret_cast(n),sizeof(structnode));n=n->next;}we.close();cout<<"录入成功"<next=NULL;re.read(reinterpret_cast(p),sizeof(structnode));h->next=p;while(!re.eof()){s=newnode;re.read(reinterpret_cast(s),sizeof(structnode));p->next=s;p=s;p->next=NULL;}re.close();returnh;}intfly::select(){node*p,*h;h=read();p=h->next;inti;cout<<"您是要按1航班号2抵达城市3起飞城市查找?"<>i;实用标准文案精彩文档if(i==1){cout<<"请输入航班号"<>i;for(;;){if(p->id==i){cout<<"航班号"<id<<"起飞地"<start<<"目的地"<over<<"起飞时间"<s_time<<"降落时间"<o_time<<"票价"<price<<"折扣"<sale<<"票数"<ticket<ticket;break;}if(p->next==NULL){cout<<"查无次航班信息"<next;}i=0;}if(i==2){charove[20];cout<<"请输入抵达城市"<>ove;for(;;){if(strcmp(p->over,ove)==0){cout<<"航班号"<id<<"起飞地"<start<<"目的地"<over<<"起飞时间"<s_time<<"降落时间"<o_time<<"票价"<price<<"折扣"<sale<<"票数"<ticket<next==NULL){break;}实用标准文案精彩文档p=p->next;}}if(i==3){charsta[20];cout<<"请输入起飞城市"<>sta;for(;;){if(strcmp(p->start,sta)==0){cout<<"航班号"<id<<"起飞地"<start<<"目的地"<over<<"起飞时间"<s_time<<"降落时间"<o_time<<"票价"<price<<"折扣"<sale<<"票数"<ticket<next==NULL){break;}p=p->next;}}}voidfly::update(){inti;node*p,*n,*h;h=read();p=h->next;cout<<"请输入您要修改的航班信息的航班号"<>i;for(;;){if(p->id==i){cout<<"航班号"<id<<"起飞地"<start<<"目的地实用标准文案精彩文档"<over<<"起飞时间"<s_time<<"降落时间"<o_time<<"票价"<price<<"折扣"<sale<<"票数"<ticket<>p->id>>p->start>>p->over>>p->s_time>>p->o_time>>p->price>>p->sale>>p->ticket;break;}if(p->next==NULL){cout<<"查无此航班信息"<next;}n=h->next;we.open("flight.txt",ios_base::trunc|ios_base::binary);while(n!=NULL){we.write(reinterpret_cast...

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

碎片内容

C版大大数据结构航空订票系统源代码

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