![鐵路客運(yùn)售票模擬系統(tǒng).doc_第1頁](http://file.renrendoc.com/FileRoot1/2020-1/15/a3781456-6c1c-4e8b-a8b7-89431a2dcf6f/a3781456-6c1c-4e8b-a8b7-89431a2dcf6f1.gif)
![鐵路客運(yùn)售票模擬系統(tǒng).doc_第2頁](http://file.renrendoc.com/FileRoot1/2020-1/15/a3781456-6c1c-4e8b-a8b7-89431a2dcf6f/a3781456-6c1c-4e8b-a8b7-89431a2dcf6f2.gif)
![鐵路客運(yùn)售票模擬系統(tǒng).doc_第3頁](http://file.renrendoc.com/FileRoot1/2020-1/15/a3781456-6c1c-4e8b-a8b7-89431a2dcf6f/a3781456-6c1c-4e8b-a8b7-89431a2dcf6f3.gif)
![鐵路客運(yùn)售票模擬系統(tǒng).doc_第4頁](http://file.renrendoc.com/FileRoot1/2020-1/15/a3781456-6c1c-4e8b-a8b7-89431a2dcf6f/a3781456-6c1c-4e8b-a8b7-89431a2dcf6f4.gif)
![鐵路客運(yùn)售票模擬系統(tǒng).doc_第5頁](http://file.renrendoc.com/FileRoot1/2020-1/15/a3781456-6c1c-4e8b-a8b7-89431a2dcf6f/a3781456-6c1c-4e8b-a8b7-89431a2dcf6f5.gif)
已閱讀5頁,還剩28頁未讀, 繼續(xù)免費(fèi)閱讀
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
學(xué)生實(shí)習(xí)報(bào)告 課程名稱_ 數(shù)據(jù)結(jié)構(gòu)與數(shù)據(jù)處理應(yīng)用訓(xùn)練 題目名稱 學(xué)生學(xué)院 專業(yè)班級 學(xué) 號(hào) 學(xué)生姓名 指導(dǎo)教師 2014 年 2 月 日XXX計(jì)算分院 計(jì)算1103【摘要】 模擬鐵路客運(yùn)售票系統(tǒng),采用鏈表結(jié)構(gòu)儲(chǔ)存數(shù)據(jù),有訂票、退票、查詢、修改、讀取文件等功能模塊,整體系統(tǒng)運(yùn)行為一個(gè)無限循環(huán),根據(jù)輸入指令進(jìn)行不同操作,主要知識(shí)有結(jié)構(gòu)的定義,鏈表的操作,循環(huán)的應(yīng)用。 【關(guān)鍵詞】 鐵路客運(yùn)售票模擬系統(tǒng),查詢車次,車票預(yù)訂,辦理退票1 內(nèi)容與要求鐵路客運(yùn)售票模擬系統(tǒng)【問題描述】鐵路客運(yùn)售票系統(tǒng)的業(yè)務(wù)活動(dòng)包括:查詢車次、車票預(yù)訂和辦理退票。試設(shè)計(jì)一個(gè)鐵路客運(yùn)售票模擬系統(tǒng),使上述業(yè)務(wù)可以借助計(jì)算機(jī)來完成。【具體要求】鐵路客運(yùn)售票處的計(jì)算機(jī)系統(tǒng)可以為客戶提供下列各項(xiàng)服務(wù):1查詢車次:根據(jù)旅客提供的出發(fā)站、到達(dá)站、出發(fā)日輸出下列信息:車次號(hào)、出發(fā)站、到達(dá)站、出發(fā)時(shí)間、到達(dá)時(shí)間、各類車票的余票額(包括軟臥、硬臥、軟座、硬座、無座)等。還可根據(jù)客戶要求,輸出某車次從起點(diǎn)站到終點(diǎn)站的各站點(diǎn)的名稱及出發(fā)時(shí)間和到達(dá)時(shí)間。2. 承辦訂票業(yè)務(wù):根據(jù)客戶提出的要求(日期、車次號(hào)、座位類別、訂票數(shù)額)查詢該車次該座位類別票額情況,若尚有余額,則為客戶辦理訂票手續(xù),并輸出座位號(hào)(座位號(hào)信息的輸出可作為選做部分);若無票或余票額少于訂票額,則需要重新詢問客戶要求。若客戶需要,可預(yù)約登記排隊(duì)等候。3承辦退票業(yè)務(wù):根據(jù)客戶提供的情況(日期、車次號(hào)、座位類別、退票數(shù)額),為客戶辦理退票手續(xù),然后查詢該車次該座位類別是否有人預(yù)約登記,首先詢問排在第一的客戶,若退票數(shù)能滿足他的要求,則為他辦理訂票手續(xù),否則依次詢問其他排隊(duì)預(yù)約的客戶。為簡化問題,可以規(guī)定同一個(gè)座位只能售出一次票,即不考慮同一個(gè)座位分不同路段出售多次。還可規(guī)定只能查詢或預(yù)訂未來3天之內(nèi)的車票,即每個(gè)車次只需分別保存3個(gè)班次的售票情況?!緦?shí)現(xiàn)提示】每個(gè)車次應(yīng)包含的信息有:車次號(hào)、出發(fā)日、起點(diǎn)站名、各中途站名、終點(diǎn)站名、各站點(diǎn)的到達(dá)時(shí)間與出發(fā)時(shí)間、各類座位車票定額、各類座位余票額、各座位是否已售出信息(選做內(nèi)容,可用一張表記錄每個(gè)座位是否已售出)、各類座位已訂票的客戶名單(包括姓名、出發(fā)站、到達(dá)站、訂票額、座位號(hào)(選做)和各類座位預(yù)約登記的客戶名單(包括姓名、出發(fā)站、到達(dá)站、所需票額)。這最后兩項(xiàng)顯然可以分別用線性表和隊(duì)列實(shí)現(xiàn)(每一類別的座位需有各自的線性表和隊(duì)列)。為查找方便,已訂票客戶的線性表應(yīng)按客戶姓名有序,并且,為插入和刪除方便,應(yīng)以鏈表作存儲(chǔ)結(jié)構(gòu);由于預(yù)約人數(shù)無法預(yù)料,隊(duì)列也應(yīng)以鏈表作存儲(chǔ)結(jié)構(gòu)。整個(gè)系統(tǒng)需匯總各車次的情況記錄在一張線性表上,由于車次基本不變,可采用順序存儲(chǔ)結(jié)構(gòu),并按車次有序,因?yàn)槊總€(gè)車次需保存未來3天的售票情況,可考慮每個(gè)車次的每一班次是這張表上的一個(gè)記錄,也可以每個(gè)車次是一個(gè)記錄,里面分別包含3趟班次的售票情況。每個(gè)記錄需定義成一個(gè)結(jié)構(gòu)類型。【測試數(shù)據(jù)】自己設(shè)計(jì),報(bào)告上要求寫出多批數(shù)據(jù)測試結(jié)果。【實(shí)現(xiàn)說明】每個(gè)同學(xué)可以根據(jù)自己的實(shí)際情況對該鐵路客運(yùn)售票模擬系統(tǒng)的功能進(jìn)行增減。有能力的同學(xué)在完成上述功能的基礎(chǔ)上,可以充分發(fā)揮自己的想象力,增加該系統(tǒng)的功能和其它服務(wù)項(xiàng)目,如可以按照實(shí)用性來完善上述模擬系統(tǒng),考慮輸出座位號(hào)信息、同一個(gè)座位允許分不同路段出售多次等;能力較弱的同學(xué)則可以簡化上述系統(tǒng),如不考慮預(yù)約登記排隊(duì)等候車票、不考慮各種座位類別(即每個(gè)車次只有一種座位)、還可以不考慮中途站點(diǎn)(即每個(gè)車次只設(shè)置起點(diǎn)站與終點(diǎn)站,中間不停)等。2 總體設(shè)計(jì)3 詳細(xì)設(shè)計(jì)路線信息typedef struct trainline /路線 char date9;/日期 char train_num8;/車次號(hào) struct station *sta;/途經(jīng)站char begin_time6;/出發(fā)時(shí)間char end_time6;/到達(dá)時(shí)間int RW;/軟臥余量 int YW;/硬臥余量int RZ;/軟座余量int YZ;/硬座余量int WZ;/無座余量struct trainline *next;/下一個(gè)節(jié)點(diǎn)trainline;??空军c(diǎn)信息typedef struct station/??空綾har stop9;/??空久鹀har stop_time;/停靠時(shí)間struct station *next;/下一個(gè)節(jié)點(diǎn)station;乘客訂票信息typedef struct customer /乘客 char name9;/顧客名 char date9;/日期 char train_num9;/車次號(hào) int seat_level;/座位類別int seat_num;/座位數(shù)量 struct customer *next;/下一個(gè)節(jié)點(diǎn) customer;找到路線鏈表中的末尾節(jié)點(diǎn)status increase_train(trainline *l,char *date,char *train_num, station *stat,char *begin_time,char *end_time, int RW,int YW,int RZ,int YZ,int WZ)/增加路線將需要插入的路線信息插入到鏈表中指定節(jié)點(diǎn)之后status insert_trainline(trainline *p,char *date,char *train_num,station *stat,char *begin_time,char *end_time,int RW,int YW,int RZ,int YZ,int WZ)/trainline鏈表插入操作將需要插入的乘客訂票信息插入到鏈表中status insert_customer(customer *p,char *name,char *date,char *train_num,int seat,int seat_num)/customer鏈表插入操作刪除某條路線,首先搜索到該路線,然后在鏈表中跳過該節(jié)點(diǎn)status delete_trainline(trainline *h,char *date,char *train_num)/刪除路線刪除某條乘客訂票記錄,首先搜索到該記錄,然后在鏈表中跳過該節(jié)點(diǎn)status delete_customer(customer *h,char *date,char *train_num)/刪除顧客修改路線座位余量,首先搜索到該路線,然后刪除對應(yīng)的座位類別的余量trainline *modefy_trainline(trainline *l,char *date,char *train_num,int seat_level,int num) /修改trainline鏈表中的數(shù)據(jù)退票,首先搜索到該訂票記錄,然后確定退票數(shù)量,如果大于訂票數(shù)量,則減去退票數(shù)量;如果等于退票數(shù)量,則刪除此訂票記錄;如果小于,則輸出數(shù)量不足,退票失敗。如果退票成功,則路線中相應(yīng)座位余量增加。status delete_cus(customer *h,trainline *l,char *name, char *date,char *train_num,int level,int num)/乘客退票以下兩個(gè)函數(shù)是為了方便操作所賦予的初始化數(shù)據(jù)status creat_trainline(trainline *l)/創(chuàng)建trainline單鏈表status creat_customer(customer *l)/創(chuàng)建customer單鏈表訂票查詢,根據(jù)提供站點(diǎn),查找路線,判斷同意路線中是否有這兩個(gè)站點(diǎn),并且順序正確void book_search(trainline *l,char *begin_place,char *end_place)/訂票查詢函數(shù)訂票,首先找到該車次,然后判斷余量是否夠,如果夠,則訂票;反之,訂票失敗。訂票成功,則增加乘客訂票記錄,兵減少相應(yīng)車次的座位余量。status book(trainline *l,char *date,char *train_num,customer *c,char *name,int seat_level,int num)/訂票函數(shù)根據(jù)路線鏈表和乘客鏈表逐個(gè)輸出信息status print_trainline(trainline *l)/打印路線信息status print_customer(customer *l)/打印乘客信息根據(jù)路線鏈表和乘客鏈表,逐個(gè)在 C盤 trainline.dat 和 customer.dat 文件中輸出信息status save_trainline(trainline *l)/保存trainline.datstatus save_customer(customer *l)/保存乘客信息 customer.dat從 C盤 trainline.dat 和 customer.dat 文件中讀取記錄,并用訂票和增加路線函數(shù)逐條添加到系統(tǒng)中status load_trainline(trainline *l) /導(dǎo)入路線信息,必須為5個(gè)站status load_customer(customer *l) /導(dǎo)入乘客信息4 程序測試3 查詢路線、乘客信息status print_trainline(trainline *l)/打印路線信息status print_customer(customer *l)/打印顧客信息1 訂票 首先查詢 出發(fā)站-終點(diǎn)站 void book_search(trainline *l,char *begin_place,char *end_place)/訂票查詢函數(shù)然后根據(jù)查詢結(jié)果購買自己需要車次 status book(trainline *l,char *date,char *train_num,customer *c,char *name,int seat_level,int num)/訂票函數(shù)訂票后的查詢結(jié)果2 退票 (可以全部退完,也可以退一部分) status delete_cus(customer *h,trainline *l,char *name,char *date,char *train_num,int level,int num)/乘客退票退票后查詢結(jié)果4 修改路線 默認(rèn)密碼12345678 代碼:pass9=123456781 增加路線 status increase_train(trainline *l,char *date,char *train_num, station *stat,char *begin_time,char *end_time, int RW,int YW,int RZ,int YZ,int WZ)/增加路線注意時(shí)間“:”為英文字符,輸入中文字符會(huì)報(bào)錯(cuò)增加路線后查詢結(jié)果2 刪除路線刪除路線后查詢結(jié)果5 讀入文件 status load_trainline(trainline *l) /導(dǎo)入路線信息,必須為5個(gè)站status load_customer(customer *l) /導(dǎo)入乘客信息隱藏密碼函數(shù)status inputpassword(char cc9)/隱藏密碼為*號(hào)的函數(shù)系統(tǒng)存檔status save_trainline(trainline *l)/保存trainline.datstatus save_customer(customer *l)/保存顧客信息 customer.dat每完成一輪操作 系統(tǒng)自動(dòng)存檔一次,如果需要繼續(xù)上一回的存檔,請打開后直接選5讀入存檔5 總結(jié)參考文獻(xiàn)1.徐孝凱.數(shù)據(jù)結(jié)構(gòu)實(shí)用教程.清華大學(xué)出版社.2006.9附錄Slove.h#define OK 1 #define TRUE 1 #define FALSE 0 #define ERROR 0 #define OVERFLOW -2 #define PR printf #define RUANW 1 #define YINGW 2#define RUANZ 3#define YINGZ 4#define WUZ 5typedef int status; typedef struct trainline /路線 char date9;/日期 char train_num8;/車次號(hào) /char begin_place9;/出發(fā)地/char end_place9;/目的地struct station *sta;/途經(jīng)站char begin_time6;/出發(fā)時(shí)間char end_time6;/到達(dá)時(shí)間/int total;/座位總數(shù)/int left;int RW;/軟臥余量 int YW;/硬臥余量int RZ;/軟座余量int YZ;/硬座余量int WZ;/無座余量struct trainline *next;/下一個(gè)節(jié)點(diǎn)trainline; typedef struct station/??空綾har stop9;/停靠站名char stop_time;/停靠時(shí)間struct station *next;/下一個(gè)節(jié)點(diǎn)station;typedef struct customer /乘客 char name9;/顧客名 char date9;/日期 char train_num9;/車次號(hào) int seat_level;/座位類別int seat_num;/座位數(shù)量 struct customer *next;/下一個(gè)節(jié)點(diǎn) customer; station *init_station()/初始化途經(jīng)站station *l;l=(station*)malloc(sizeof(station); if(l=NULL) exit(0); l-next=NULL; return l; trainline *init_trainline() /初始化路線鏈表 trainline *l; l=(trainline*)malloc(sizeof(trainline); if(l=NULL) exit(0); l-next=NULL; return l; customer * init_customer()/初始化乘客鏈表 customer *l; l=(customer*)malloc(sizeof(customer); if(l=NULL) exit(0);l-next=NULL; return l; status insert_trainline(trainline *p,char *date,char *train_num,/char *begin_place,char *end_place,station *stat,char *begin_time,char *end_time,int RW,int YW,int RZ,int YZ,int WZ)/trainline鏈表插入操作 trainline *q; q=(trainline*)malloc(sizeof(trainline); strcpy(q-date , date); strcpy(q-train_num , train_num); /strcpy(q-begin_place , begin_place); /strcpy(q-end_place , end_place); q-sta=stat;strcpy(q-begin_time , begin_time); strcpy(q-end_time , end_time); q-RW =RW; q-YW =YW; q-RZ =RZ; q-YZ =YZ;q-WZ =WZ; q-next=NULL; (*p)-next=q; (*p)=(*p)-next; /PR(insert %d ,%dis succssed!n,e,bl); return OK; status insert_customer(customer *p,char *name,char *date,char *train_num,int seat,int seat_num)/customer鏈表插入操作 customer *q; q=(customer*)malloc(sizeof(customer); /* PR(內(nèi)存分配失敗n); return OVERFLOW; */ strcpy(q-name , name); strcpy(q-date , date); strcpy(q-train_num , train_num);q-seat_level =seat; q-seat_num =seat_num; q-next=NULL; (*p)-next=q; (*p)=(*p)-next; /PR(insert %d ,%dis succssed!n,e,bl); return OK; status delete_trainline(trainline *h,char *date,char *train_num)/刪除路線 trainline *p,*pr; pr=h; p=pr-next ; while(p!=NULL) if(strcmp(date,p-date )=0 & strcmp(train_num,p-train_num )=0) pr-next =p-next ; PR(刪除 %s 車次n,p-date ); return OK; pr=pr-next ; p=pr-next ; PR(無此車次,無法刪除!n); return ERROR; status delete_customer(customer *h,char *date,char *train_num)/刪除顧客 customer *p,*pr; pr=h; p=pr-next ; while(p!=NULL) if(strcmp(date,p-date )=0 & strcmp(train_num,p-train_num )=0) pr-next =p-next ; pr=pr-next ; p=pr-next ; return OK; trainline *modefy_trainline(trainline *l,char *date,char *train_num,int seat_level,int num) /修改trainline鏈表中的數(shù)據(jù) trainline *p; p=l-next ; for(;p!=NULL;p=p-next ) if(strcmp(date,p-date )=0 & strcmp(train_num,p-train_num )=0) if(seat_level = RUANW) p-RW += num; else if(seat_level = YINGW) p-YW += num;else if(seat_level = RUANZ) p-RZ += num;else if(seat_level = YINGZ) p-YZ += num;else if(seat_level = WUZ) p-WZ += num;/ PR(modefy %sn,p-line_num ); return l; PR(沒有這個(gè)路線,無法完成修改任務(wù)!n); return 0; status delete_cus(customer *h,trainline *l,char *name,char *date,char *train_num,int level,int num)/乘客退票 customer *p,*pr; int seat_num;/ qr=h; pr=h; p=pr-next ; / PR(開始刪除n); while(p!=NULL) if(strcmp(name,p-name )=0 & strcmp(date,p-date )=0 & strcmp(train_num,p-train_num )=0 & level=p-seat_level) seat_num=p-seat_num;l=modefy_trainline(l,date,train_num,level,num); if(num = seat_num)pr-next =p-next ; PR(乘客 %s 退票成功!n,p-name ); else if(num seat_num -= num;PR(乘客 %s 退票成功!n,p-name );else PR(數(shù)量不足,退票失敗!n,p-name ); return OK; pr=pr-next ; p=pr-next ; PR(無此顧客,無法退票!n); return ERROR; status creat_trainline(trainline *l)/創(chuàng)建trainline單鏈表 trainline *p=*l; int i=0; char *date3=20140224,20140226,20140225; char *train_num3=T01,D02,G03; char place359=北京,杭州,上海,南昌,廣州, 廣州,上海,金山,北京,敦煌, 嘉興,北京,上海,山西,深圳;station *stat3;for(i=0;i3;i+)stati=init_station();for(int j=0;jstop,placeij);/可以在這里加停靠時(shí)間st-next=stati;stati=st;/stati-next=NULL;char *begin_time3=12:02,22:42,05:09; char *end_time3=17:15,06:07,10:54; int RW3=100,100,100; int YW3=100,100,100; int RZ3=100,100,100;int YZ3=100,100,100;int WZ3=100,100,100;for (i=0;i3;i+) insert_trainline(&p,datei,train_numi,stati,/begin_placei,end_placei, begin_timei,end_timei,RWi,YWi,RZi,YZi,WZi); return OK; status creat_customer(customer *l)/創(chuàng)建customer單鏈表 customer *p=*l; int i=0; char *name3=yangj,yunhl,fangs; char *date3=20140224,20140225,20140226; char *train_num3=T01,G03,D02; int seat_level3=RUANW,YINGZ,WUZ; int seat_num3=2,3,4;for (i=0;inext ; for(;p-next !=NULL;p=p-next) insert_trainline(&p,date,train_num,stat,/begin_place,end_place, begin_time,end_time,RW,YW,RZ,YZ,WZ); PR(增加車次 %s %s 成功!n,date,train_num); return OK; status book(trainline *l,char *date,char *train_num,customer *c,char *name,int seat_level,int num)/訂票函數(shù) trainline *p=l; customer *q=c-next ; p=l-next ; for(;q-next !=NULL;q=q-next) / PR(%sn,q-name ); for(;p!=NULL;p=p-next ) if(strcmp(date,p-date )=0) if(seat_level = RUANW & p-RW 0) PR(恭喜您!訂票成功!n); insert_customer(&q,name,date,train_num,seat_level,num); p-RW -=num; return OK; else if(seat_level = YINGW & p-YW 0) PR(恭喜您!訂票成功!n); insert_customer(&q,name,date,train_num,seat_level,num); p-YW -=num; return OK; else if(seat_level = RUANZ & p-RZ 0) PR(恭喜您!訂票成功!n); insert_customer(&q,name,date,train_num,seat_level,num); p-RZ -=num; return OK; else if(seat_level = YINGZ & p-YZ 0) PR(恭喜您!訂票成功!n); insert_customer(&q,name,date,train_num,seat_level,num); p-YZ -=num; return OK; else if(seat_level = WUZ & p-WZ 0) PR(恭喜您!訂票成功!n); insert_customer(&q,name,date,train_num,seat_level,num); p-WZ -=num; return OK; else PR(對不起,余量不足!n); return 0; PR(對不起,沒有這個(gè)路線號(hào)!n); return ERROR; void book_search(trainline *l,char *begin_place,char *end_place)/訂票查詢函數(shù) trainline *p=l; /customer *q=c-next ; p=l-next ; /for(;q-next !=NULL;q=q-next) / PR(%sn,q-name ); for(;p!=NULL;p=p-next ) station *st=p-sta;int stop_begin=0,stop_end=0,flag=1;for(;st-next!=NULL;st=st-next)if(strcmp(begin_place,st-stop )=0) stop_begin=flag+;if(strcmp(end_place,st-stop )=0) stop_end=flag+;if(stop_begin=1 & stop_end=2)PR(%15s%5s%12s%c%5s%10d%5d%5d%5d%5dn,p-date ,p-train_num , /p-begin_place ,-,p-end_place ,p-begin_time ,-,p-end_time , p-RW ,p-YW,p-RZ ,p-YZ ,p-WZ ); station *st=p-sta;PR(途經(jīng): );for(;st-next!=NULL;st=st-next)PR(%s ,st-stop);PR(n);break; status print_trainline(trainline *l)/打印路線信息 trainline *p=l-next ; for(;p!=NULL;p=p-next ) PR(%15s%5s%12s%c%5s%10d%5d%5d%5d%5dn,p-date ,p-train_num , /p-begin_place ,-,p-end_place , p-begin_time ,-,p-end_time , p-RW ,p-YW,p-RZ ,p-YZ ,p-WZ ); station *st=p-sta;PR(途經(jīng): );for(;st-next!=NULL;st=st-next)PR(%s ,st-stop);PR(n); return OK; status print_customer(customer *l)/打印顧客信息 customer *p=l-next ; for(;p!=NULL;p=p-next ) PR(%5s %9s %5s %6d %6dn,p-name ,p-date ,p-train_num ,p-seat_level ,p-seat_num ); return OK; status save_trainline(trainline *l)/保存trainline.dat FILE *fp_trainline; trainline *p=l-next ; char filename=c:trainline.dat; if(fp_trainline=fopen(filename,wb)=NULL) printf(can not open file to write:%sn,filename); return ERROR; for(;p!=NULL;p=p-next ) fprintf(fp_trainline,%s,%s,%s,%s,%d,%d,%d,%d,%d,p-date ,p-train_num , /p-begin_place ,p-end_place , p-begin_time ,p-end_time ,p-RW ,p-YW ,p-RZ ,p-YZ ,p-WZ ); station *st=p-sta;for(;st-next!=NULL;st=st-next)fprintf(fp_trainline,%s,st-stop);fprintf(fp_trainline,#); fclose(fp_trainline); return OK; status save_customer(customer *l)/保存顧客信息 customer.dat FILE *fp_customer; customer *p=l-next ; char filename=c:customer.dat; if(fp_customer=fopen(filename,wb)=NULL) printf(can not open file to write:%sn,filename); return ERROR; for(;p!=NULL;p=p-next ) / PR(%s,%s,%dn,p-name ,p-line_num ,p-seat_num ); fprintf(fp_customer,%s,%s,%s,%d,%d,#,p-name ,p-date ,p-train_num ,p-seat_level ,p-seat_num ); fclose(fp_customer); return OK; int changStrInt(char *ch)/把字符串轉(zhuǎn)化為整型 int a=1,b=0,c=0,i; for (i=strlen(ch)-1;i=0;i-) if (chi47) b=a*(chi-48); a=a*10; c=c+b; else PR(%c 不合法,無法將此字符串轉(zhuǎn)化為整形!n,chi); return 0; / printf(the c is %dn,c); return c; status load_trainline(trainline *l) /導(dǎo)入路線信息,必須為5個(gè)站FILE *fp_trainline; int flag=0,i=0; char ch; char date9;/日期 char train_num9;/車次號(hào) char begin_time6,end_time6;/時(shí)間char RW_str5,YW_str5,RZ_str5,YZ_str5,WZ_str5;/座位余量字符串int RW,YW,RZ,YZ,WZ;/座位余量 char place9;/站名station *sta=init_station();/途經(jīng)站/ trainline *p=l; char filename=c:trainline.dat; if(fp_trainline=fopen(filename,rb)=NULL) printf(can not open file to load:%sn,filename); return ERROR; while(!feof(fp_trainline) ch=fgetc(fp_trainline); if(ch!=#) if(flag=0&ch!=,) datei=ch; i+; else
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 蘇科版數(shù)學(xué)七年級下冊聽評課記錄10.5用二元一次方程組解決問題2
- 四年級數(shù)學(xué)口算練習(xí)題
- 護(hù)理學(xué)導(dǎo)論情景劇表演劇本
- 新生兒腭裂喂養(yǎng)護(hù)理
- 2024年秋七年級英語上冊Unit2LetsplaysportsReading作業(yè)設(shè)計(jì)新版牛津版
- 重慶城市科技學(xué)院《經(jīng)濟(jì)政策(economcpoces)》2023-2024學(xué)年第二學(xué)期期末試卷
- 綿陽師范學(xué)院《電子電路應(yīng)用》2023-2024學(xué)年第二學(xué)期期末試卷
- 井岡山大學(xué)《醫(yī)學(xué)信息系統(tǒng)設(shè)計(jì)》2023-2024學(xué)年第二學(xué)期期末試卷
- 2025年人形機(jī)器人行業(yè)發(fā)展趨勢
- 長沙幼兒師范高等??茖W(xué)校《網(wǎng)絡(luò)工程》2023-2024學(xué)年第二學(xué)期期末試卷
- 《梅大高速茶陽路段“5·1”塌方災(zāi)害調(diào)查評估報(bào)告》專題警示學(xué)習(xí)
- 2024年09月北京中信銀行北京分行社會(huì)招考(917)筆試歷年參考題庫附帶答案詳解
- 《大健康解讀》課件
- 2025年度交通運(yùn)輸規(guī)劃外聘專家咨詢協(xié)議3篇
- 2024年04月北京中信銀行北京分行社會(huì)招考(429)筆試歷年參考題庫附帶答案詳解
- 專項(xiàng)債券培訓(xùn)課件
- 《會(huì)務(wù)的組織和管理》課件
- 2024年公司領(lǐng)導(dǎo)在新年動(dòng)員會(huì)上的講話樣本(3篇)
- 《倒虹吸管安全評價(jià)導(dǎo)則》
- 2025年中國濕度傳感器行業(yè)深度分析、投資前景、趨勢預(yù)測報(bào)告(智研咨詢)
- 《儒林外史》(第13-30回)-初中整本書閱讀系列之《儒林外史》
評論
0/150
提交評論