日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > windows >内容正文

windows

火车站购票系统c语言编程,用c语言编写火车购票系统怎么编写,在线等,急!!!...

發布時間:2025/4/16 windows 16 豆豆
生活随笔 收集整理的這篇文章主要介紹了 火车站购票系统c语言编程,用c语言编写火车购票系统怎么编写,在线等,急!!!... 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

#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",num);

if(strcmp(num,"0")==0)

break?;

/*判斷是否已經存在*/

while(s)

{

if(strcmp(s->data。

num,num)==0)

{

printf("the?train?'%s'has?been?born!

",num);

return?;

}

s?=?s->next?;

}

p?=?(struct?node*)malloc(sizeof(struct?node));

strcpy(p->data。

num,num);

printf("Input?the?city?where?the?train?will?reach:");

scanf("%s",p->data。city);

printf("Input?the?time?which?the?train?take?off:");

scanf("%s",p->data。

takeoffTime);

printf("Input?the?time?which?the?train?receive:");

scanf("%s",&p->data。receiveTime);

printf("Input?the?price?of?ticket:");

scanf("%d",&p->data。

price);

printf("Input?the?number?of?booked?tickets:");

scanf("%d",&p->data。bookNum);

p->next=NULL?;

r->next=p?;

r=p?;

shoudsave?=?1?;

}

}

/*打印火車票信息*/

void?printTrainInfo(struct?node*p)

{

puts("

The?following?is?the?record?you?want:");

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

",p->data。

num);

printf(">>city?the?train?will?reach:?%s

",p->data。city);

printf(">>the?time?the?train?take?off:?%s

the?time?the?train?reach:?%s

",p->data。

takeoffTime,p->data。receiveTime);

printf(">>the?price?of?the?ticket:?%d

",p->data。price);

printf(">>the?number?of?booked?tickets:?%d

",p->data。

bookNum);

}

struct?node?*?Locate1(Link?l,char?findmess[],char?numorcity[])

{

Node*r?;

if(strcmp(numorcity,"num")==0)

{

r=l->next?;

while(r)

{

if(strcmp(r->data。

num,findmess)==0)

return?r?;

r=r->next?;

}

}

else?if(strcmp(numorcity,"city")==0)

{

r=l->next?;

while(r)

{

if(strcmp(r->data。

city,findmess)==0)

return?r?;

r=r->next?;

}

}

return?0?;

}

/*查詢火車信息*/

void?QueryTrain(Link?l)

{

Node?*p?;

int?sel?;

char?str1[5],str2[10];

if(!l->next)

{

printf("There?is?not?any?record?!");

return?;

}

printf("Choose?the?way:

>>1:according?to?the?number?of?train;

>>2:according?to?the?city:

");

scanf("%d",&sel);

if(sel==1)

{

printf("Input?the?the?number?of?train:");

scanf("%s",str1);

p=Locate1(l,str1,"num");

if(p)

{

printTrainInfo(p);

}

else

{

mark1=1?;

printf("

the?file?can't?be?found!");

}

}

else?if(sel==2)

{

printf("Input?the?city:");

scanf("%s",str2);

p=Locate1(l,str2,"city");

if(p)

{

printTrainInfo(p);

}

else

{

mark1=1?;

printf("

the?file?can't?be?found!");

}

}

}

/*訂票子模塊*/

void?BookTicket(Link?l,bookManLink?k)

{

Node*r[10],*p?;

char?ch,dem?;

bookMan*v,*h?;

int?i=0,t=0?;

char?str[10],str1[10],str2[10];

v=k?;

while(v->next!=NULL)

v=v->next?;

printf("Input?the?city?you?want?to?go:?");

scanf("%s",&str);

p=l->next?;

while(p!=NULL)

{

if(strcmp(p->data。

city,str)==0)

{

r[i]=p?;

i ;

}

p=p->next?;

}

printf("

the?number?of?record?have?%d

",i);

for(t=0;t

");

scanf("%d",&ch);

if(ch?==?1)

{

h=(bookMan*)malloc(sizeof(bookMan));

printf("Input?your?name:?");

scanf("%s",&str1);

strcpy(h->data。

name,str1);

printf("Input?your?id:?");

scanf("%s",&str2);

strcpy(h->data。num,str2);

printf("Input?your?bookNum:?");

scanf("%d",&dem);

h->data。

bookNum=dem?;

h->next=NULL?;

v->next=h?;

v=h?;

printf("

Lucky!you?have?booked?a?ticket!");

getch();

shoudsave=1?;

}

}

}

bookMan*Locate2(bookManLink?k,char?findmess[])

{。

全部

總結

以上是生活随笔為你收集整理的火车站购票系统c语言编程,用c语言编写火车购票系统怎么编写,在线等,急!!!...的全部內容,希望文章能夠幫你解決所遇到的問題。

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

主站蜘蛛池模板: 亚洲视频二 | 国产熟妇乱xxxxx大屁股网 | 国模视频在线 | 日本japanese丰满白浆 | 99热精品在线 | 成人爽站w47pw | 久国产视频 | 日韩毛片大全 | 69黄色片| 国产视频不卡一区 | 日韩av一区在线 | 五月婷婷天堂 | 精品人妻伦九区久久aaa片 | 天天爽夜夜爽夜夜爽精品视频 | 日韩欧美国产视频 | 免费看裸体网站 | 国产欧美一区二区三区在线看 | 中文字幕一二 | 日韩视频在线观看一区二区 | 日韩avwww| 国产区精品视频 | 亚洲黄色小视频 | 欧美少妇毛茸茸 | 一卡二卡三卡视频 | 亚洲精品国产成人av在线 | 嫩草影院一区 | 成人aⅴ视频 | 国产成人午夜视频 | 色无极影院亚洲 | 成人国产精品一区二区 | 男生插女生网站 | 久久久久久久91 | av免费入口 | 好吊日免费视频 | 久色91| 正在播放木下凛凛88av | 吊侵犯の奶水授乳羞羞漫画 | 国产成人啪免费观看软件 | 日本免费不卡一区二区 | 欧美日韩va | 国产午夜免费 | 欧美午夜精品一区二区 | 免费福利影院 | 亚洲精品无码成人 | www.av72| 国产伦精品一区二区三区视频黑人 | 91福利网址| 欧美激情在线一区二区 | 九九精品在线观看 | 久久精品人妻av一区二区三区 | 中文字幕在线免费看线人 | 国产精品人妖 | 日韩电影一二三区 | 欧美猛交免费 | 免费看久久 | 欧美一区欧美二区 | 伊人三级 | 日韩不卡av在线 | av片在线观看网站 | 国产91在线视频 | 四虎国产成人精品免费一女五男 | 激情综合区 | 午夜高清视频 | 亚洲七区 | 高级家教课程在线观看 | 伊人网视频 | 狠狠干夜夜骑 | 天堂成人国产精品一区 | 噜噜噜久久 | 91亚洲视频在线 | 中文字幕在线三区 | 中文字幕不卡在线播放 | 91综合国产 | 国产成人午夜精品无码区久久 | 欧美在线资源 | 国产精品久久久久久久久久免费看 | 亚洲伦理一区 | 一区二区国产在线观看 | 国产香蕉视频在线 | wwwxxx在线观看 | 激情综合小说 | 国产老女人精品毛片久久 | 激情图片区 | 福利视频一区 | 天堂网av中文字幕 | 妖精视频在线观看免费 | 成人精品福利视频 | 国产美女菊爆在线播放APP | 夜夜操天天操 | av片在线免费看 | 日韩综合av | 欧美www | 涩涩亚洲 | 黄瓜视频色版 | 日本免费一区二区三区最新 | 国产美女自拍视频 | 国产传媒视频在线 | 国产资源在线视频 | 五月天视频网 |