最新文章专题视频专题问答1问答10问答100问答1000问答2000关键字专题1关键字专题50关键字专题500关键字专题1500TAG最新视频文章推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37视频文章20视频文章30视频文章40视频文章50视频文章60 视频文章70视频文章80视频文章90视频文章100视频文章120视频文章140 视频2关键字专题关键字专题tag2tag3文章专题文章专题2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章专题3
当前位置: 首页 - 正文

火车售票系统

来源:动视网 责编:小OO 时间:2025-10-01 21:09:54
文档

火车售票系统

#include#include#include#includeintshoudsave=0;intcount1=0,count2=0,mark=0,mark1=0;/*定义存储火车信息的结构体*/structtrain{charnum[10];/*列车号*/charcity[10];/*目的城市*/chartakeoffTime[10];/*发车时间*/charreceiveTime[10];/*到达时间*/intprice;/*票价*/intbookNum;/*票数*/};/*订票人的信息
推荐度:
导读#include#include#include#includeintshoudsave=0;intcount1=0,count2=0,mark=0,mark1=0;/*定义存储火车信息的结构体*/structtrain{charnum[10];/*列车号*/charcity[10];/*目的城市*/chartakeoffTime[10];/*发车时间*/charreceiveTime[10];/*到达时间*/intprice;/*票价*/intbookNum;/*票数*/};/*订票人的信息
#include

#include

#include

#include

int shoudsave=0 ;

int count1=0,count2=0,mark=0,mark1=0 ;

/*定义存储火车信息的结构体*/

struct train

{

char num[10];/*列车号*/

char city[10];/*目的城市*/

char takeoffTime[10];/*发车时间*/

char receiveTime[10];/*到达时间*/

int price;/*票价*/

int bookNum ;/*票数*/

};

/*订票人的信息*/

struct man

{

char num[10];/*ID*/

char name[10];/*姓名*/

int bookNum ;/*需求的票数*/

};

/*定义火车信息链表的结点结构*/

typedef struct node

{

struct train data ;

struct node * next ;

}Node,*Link ;

/*定义订票人链表的结点结构*/

typedef struct people

{

struct man data ;

struct people*next ;

}bookMan,*bookManLink ;

/* 初始界面*/

void printInterface()

{

puts("********************************************************");

puts("* Welcome to use the system of booking tickets *");

puts("********************************************************");

puts("* You can choose the operation: *");

puts("* 1:Insert a train information *");

puts("* 2:Inquire a train information *");

puts("* 3:Book a train ticket *");

puts("* 4:Update the train information *");

puts("* 5:Advice to you about the train *");

puts("* 6:save information to file *");

puts("* 7:quit the system *");

puts("********************************************************");

}

/*添加一个火车信息*/

void InsertTraininfo(Link linkhead)

{

struct node *p,*r,*s ;

char num[10];

r = linkhead ;

s = linkhead->next ;

while(r->next!=NULL)

r=r->next ;

while(1)

{

printf("please input the number of the train(0-return)");

scanf("%s

r=p ;

shoudsave = 1 ;

}

}

/*打印火车票信息*/

void printTrainInfo(struct node*p)

{

puts("\

The following is the record you want:");

printf(">>number of train: %s\

rintf("Input your id: ");

scanf("%s

;

fp=fopen("c:\\\rain.txt

InsertTraininfo(l);break ;

case 2 :

QueryTrain(l);break ;

case 3 :

BookTicket(l,k);break ;

case 4 :

UpdateInfo(l);break ;

case 5 :

AdvicedTrains(l);break ;

case 6 :

SaveTrainInfo(l);SaveBookmanInfo(k);break ;

case 7 :

return 0;

}

printf("\

please press any key to continue.......");

getch();

}

return 0;

}

文档

火车售票系统

#include#include#include#includeintshoudsave=0;intcount1=0,count2=0,mark=0,mark1=0;/*定义存储火车信息的结构体*/structtrain{charnum[10];/*列车号*/charcity[10];/*目的城市*/chartakeoffTime[10];/*发车时间*/charreceiveTime[10];/*到达时间*/intprice;/*票价*/intbookNum;/*票数*/};/*订票人的信息
推荐度:
  • 热门焦点

最新推荐

猜你喜欢

热门推荐

专题
Top