#include <conio.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <dos.h>
#define HEADER1 " -------------------------------BOOK TICKET--------------------------------\n"
#define HEADER2 " | number |start city|reach city|takeofftime|receiveime|price|ticketnumber|\n"
#define HEADER3 " |----------|----------|----------|-----------|----------|-----|------------|\n"
#define FORMAT " |%-10s|%-10s|%-10s|%-10s |%-10s |%5d| %5d |\n"
#define DATA p->data.num,p->data.startcity,p->data.reachcity,p->data.takeofftime,p->data.receivetime,p->data.price,p->data.ticketnum
int saveflag=0 ;
/*定义存储火车信息的结构体*/
struct train
{
char num[10];/*列车号*/
char startcity[10];/*出发城市*/
char reachcity[10];/*目的城市*/
char takeofftime[10];/*发车时间*/
char receivetime[10];/*到达时间*/
int price;/*票价*/
int ticketnum;/*票数*/
};
/*订票人的信息*/
struct man
{
char num[10];/*ID*/
char name[10];/*姓名*/
int bookNum ;/*订的票数*/
};
/*定义火车信息链表的结点结构*/
typedef struct node
{
struct train data ;
struct node * next ;
}Node,*Link ;
/*定义订票人链表的结点结构*/
typedef struct Man
{
struct man data ;
struct Man *next ;
}book,*bookLink ;
/*初始界面*/
void menu()
{
puts("\n\n");
puts("\t\t|------------------------------------------------------|");
puts("\t\t| Booking Tickets |");
puts("\t\t|------------------------------------------------------|");
puts("\t\t| 0:quit the system |");
puts("\t\t| 1:Insert a train information |");
puts("\t\t| 2:Search a train information |");
puts("\t\t| 3:Book a train ticket |");
puts("\t\t| 4:Modify the tarin information |");
puts("\t\t| 5:Show the train information |");
puts("\t\t| 6.save information to file |");
puts("\t\t|----------------------
把购票的代码发出来,方便给你更好的解决问题,你这只显示一部分