日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

航空订票系统php,C++版数据结构航空订票系统源代码.doc

發布時間:2023/12/10 58 豆豆
生活随笔 收集整理的這篇文章主要介紹了 航空订票系统php,C++版数据结构航空订票系统源代码.doc 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

C++版數據結構航空訂票系統源代碼.doc

#ifndef _FLIGHT_H_#define _FLIGHT_H_#includeusing namespace std;struct node{int id;char start[20];char over[20];float s_time;float o_time;int price;float sale;int ticket;struct node *next;};struct people{char name[20];char passpart[20];int ticket;int id;int number;struct people *next;

};

class fly{public:void add();node* read();int select();void update();void update_ticket(int id,int u_id);ofstream we;ifstream re;

private:node *head;

};

class user:public fly{public:int add();int insert();void dele();int user_id;

};#endif#include"iostream"#include"flight.h"#include"fstream"using namespace std;

void fly::add(){int i;node *p=new node;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<>i;if(i==1){s=new node;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(struct node));n=n->next;}we.close();cout<

node* fly::read(){re.open("flight.txt",ios_base::binary|ios_base::in);node *h,*s,*p;h=new node;p=new node;

p->next=NULL;re.read(reinterpret_cast(p),sizeof(struct node));h->next=p;while(!re.eof()){s=new node;re.read(reinterpret_cast(s),sizeof(struct node));p->next=s;p=s;p->next=NULL;}re.close();return h;

}

int fly::select(){node *p,*h;h=read();p=h->next;int i;cout<>i;if(i==1){cout<>i;for(;;){if(p->id==i){cout<id<sta

總結

以上是生活随笔為你收集整理的航空订票系统php,C++版数据结构航空订票系统源代码.doc的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。