fly.h 头文件
/////////////////////////////////////////////////////////////////////////////////
#include <iostream>
using namespace std;
#define FALSE 0
#define TRUE 1
#define OVERFLOW 0
#define OK 1
#define ERROR 0
//#define NULL 0
struct Reserved{ //ÒѶ©Æ±µÄ¹Ë¿Í
string name;
string Date;
string plane; //º½°àºÅ
int total; //¶¥Æ±Êý
//int money;
};
typedef struct LNode{
Reserved data;
struct LNode *next;
}LNode,*LinkList;
struct wait{ //Ô¤Ô¼µÇ¼ÇµÄ¹Ë¿Í
char name;
char Date;
char plane;
int need; //ËùÐèҪƱ¶î
};
typedef struct QNode{
wait data;
struct QNode *next;
}QNode,*QueuePtr;
typedef struct {
QueuePtr front;//¶ÓÍ·Ö¸Õë
QueuePtr rear;//¶ÓβָÕë
}LinkQueue;
struct Air{ //º½ÏßµÄÐÅÏ¢
char laststation[10]; //ÖÕµãÕ¾Ãû
char number[10]; //º½°àºÅ
char Date[20]; //·ÉÐÐÈÕÆÚ
int People; //³ËÔ±¶¨¶î
int Available; //ÓàƱ¶î
struct Reserved *top; //ÒѹºÆ±È˵ÄÍ·Ö¸Õë
struct wait *front,*rear;//Õâ¸öÖ¸ÕëÊǵȴý¶ÓÁеÄÍ·Ö¸ÕëºÍβָÕë
}Air_Inf[20]={{"xi'an","1","1",30,20},{"beijing","AC002","2",15,15},{"tianjin"
,"AC003","3",20,20},{"shanghai","AC004","4",20,20}};
bool Inquire( );
int Reserve();
int waiting();
void Return();
void Reserved( );
char InitQueue(LinkQueue &Q);
char DestroyQueue(LinkQueue &Q);
char EnQueue(LinkQueue &Q,wait e);
char DeQueue(LinkQueue &Q,wait e);
char QueueEmpty(LinkQueue Q);
void CreateList();