nuc_reservation.h#v0.1
作者:互联网
enum{Empty, Full};//Empty == 0; Full == 1;
enum{Unpaid, Paid, Underway, Finished, Canceled};//Unpaid == 0; Paid == 1; Underway == 2; Finished == 3; Canceled == 4;
#define MaxSeat 500//now it is about 200 to 400;
#define MaxOrder 100
#define FlightNumber 10
#define IdNumber 18//ID card rule;
#define OrderNumber 14//8 + 6, the daily limit is 1 million;
#define AirportName 20
#define CustomerName 15
typedef struct {
int present;//present <= MaxSeat;
int position[MaxSeat + 1];//subscript is its seat number; it can be Empty or Full;
}seat;
typedef struct {
int year;
int month;
int day;
int hour;
int minute;
}date;
typedef struct {
char number[FlightNumber];
date time_on;
date time_off;
char airport_on[AirportName];
char airport_off[AirportName];
double price;
double discount;//>0; <=1;
seat seats;
}flight;
typedef struct {
char number[OrderNumber];
char customer[CustomerName];
char flight[FlightNumber];
int condation;//it can be Unpaid, Paid, Underway, Finished or Canceled;
}order;
typedef struct {
order* queue[MaxOrder];
int front;
int rear;
int amount;
}olist;//orders will be FIFO;
typedef struct {
char id[IdNumber];
char name[CustomerName];
olist orders;
}customer;
标签:typedef,struct,int,FlightNumber,v0.1,char,reservation,nuc,define 来源: https://blog.csdn.net/m0_63047274/article/details/122049477