VC++2013火車票信息管理系統(tǒng)課程設(shè)計(jì)報(bào)告材料_第1頁
VC++2013火車票信息管理系統(tǒng)課程設(shè)計(jì)報(bào)告材料_第2頁
VC++2013火車票信息管理系統(tǒng)課程設(shè)計(jì)報(bào)告材料_第3頁
已閱讀5頁,還剩29頁未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡介

1、河北工業(yè)大學(xué)計(jì)算機(jī)軟件技術(shù)基礎(chǔ)(VC 2013年課程設(shè)計(jì)報(bào)告學(xué)院 信息工程學(xué)院 班級(jí) 通信121班 姓名 李小帥 學(xué)號(hào)122208成績一、題目火車票信息管理系統(tǒng)(19)、設(shè)計(jì)思路1、總體設(shè)計(jì)1)分析程序的功能在火車票信息管理系統(tǒng)的主菜單界面中,用戶可選擇不同的選項(xiàng),根據(jù)不同選 項(xiàng)的提示操作,然后程序輸出用戶進(jìn)行操作的結(jié)果。2)系統(tǒng)總體結(jié)構(gòu):該程序的過程可由這幾部分組成:顯示系統(tǒng)主界面,錄入火車時(shí)刻信息,查詢火車時(shí)刻信息,統(tǒng)計(jì)火車車次,排序火車時(shí)刻信息,瀏覽火車時(shí)刻信息,退出系統(tǒng)總共七個(gè)步驟:模塊函數(shù)名稱顯示系統(tǒng)主界面menu錄入火車時(shí)刻信息in put查詢火車時(shí)刻信息search統(tǒng)計(jì)火車車次s

2、tatistics排序火車時(shí)刻信息sort瀏覽火車時(shí)刻信息view退出系統(tǒng)對(duì)于每一次選擇,關(guān)注的數(shù)據(jù)有六個(gè):車次,起點(diǎn),終點(diǎn),開車時(shí)間,到達(dá)時(shí) 間,票價(jià)。這組數(shù)據(jù)內(nèi)部耦合度很高,所以考慮把他們封裝為結(jié)構(gòu)體數(shù)組和結(jié)構(gòu)體 變量。車次,起點(diǎn),終點(diǎn),開車時(shí)間,到達(dá)時(shí)間,票價(jià)的初值由用戶錄入。表示信息成員名稱車次trainnum起點(diǎn)startp終占乙八、endp開車時(shí)間startt到達(dá)時(shí)間endt票價(jià)price結(jié)構(gòu)體:time in put結(jié)構(gòu)體數(shù)組:t結(jié)構(gòu)體變量:who2、各功能模塊的設(shè)計(jì):說明各功能模塊的實(shí)現(xiàn)方法1) menu模塊該函數(shù)是要輸出火車票信息管理系統(tǒng)的主菜單界面,不需要返回值。主菜單界面

3、如下歡迎使用火車票信息管理系統(tǒng)主菜單 錄入火車時(shí)刻信息,請(qǐng)選擇:1 查詢火車時(shí)刻信息,請(qǐng)選擇:2 統(tǒng)計(jì)火車車次,請(qǐng)選擇:3排序火車時(shí)刻信息:請(qǐng)選擇:4 瀏覽火車時(shí)刻信息:請(qǐng)選擇:5 退出,請(qǐng)選擇:0代碼參見menu函數(shù)。2) in put 模塊該函數(shù)是要實(shí)現(xiàn)為車次,起點(diǎn),終點(diǎn),開車時(shí)間,到達(dá)時(shí)間,票價(jià)賦初值,不 需要返回值。為了能夠?qū)崿F(xiàn)隨時(shí)停止錄入的功能,每當(dāng)用戶輸入車次時(shí),都要進(jìn)行 判斷,當(dāng)輸入車次為0時(shí),則停止錄入,返回系統(tǒng)主界面,否則繼續(xù)錄入。代碼參見in put函數(shù)。3) search 模塊該函數(shù)是要實(shí)現(xiàn)按兩種不同方式查詢火車時(shí)刻信息,不需要返回值。選擇的方式和判斷有無該車次可使用查表

4、的方法來解決。表格如下選擇提示判斷有無該車次1按照車次查詢,請(qǐng)選擇:1有輸出該車次火車時(shí)刻信息無輸出“無此車次!”2按照起點(diǎn)和終點(diǎn)查詢,請(qǐng)選擇:2有輸出該車次火車時(shí)刻信息無輸出“無此車次!”輸入其他選擇時(shí)(即不是1或2),輸出“輸入錯(cuò)誤!請(qǐng)重新選擇!代碼參見search函數(shù)。4)statistics 模塊該函數(shù)是要實(shí)現(xiàn)按兩種不同方式統(tǒng)計(jì)火車車次,不需要返回值。選擇的方式和 統(tǒng)計(jì)火車的車次可使用查表的方法來解決。表格如下選擇提示統(tǒng)計(jì)火車的車次1按起點(diǎn)統(tǒng)計(jì)每日的車次數(shù),請(qǐng)選擇:1輸出該起點(diǎn)每日的車次數(shù)2按終點(diǎn)統(tǒng)計(jì)每日的車次數(shù),請(qǐng)選擇:2輸出該終點(diǎn)每日的車次數(shù)輸入其他選擇時(shí)(即不是1或2),輸出“輸

5、入錯(cuò)誤!請(qǐng)重新選擇! ”代碼參見statistics 函數(shù)。5)sort模塊該函數(shù)是要實(shí)現(xiàn)按兩種不同方式排序火車時(shí)刻信息,不需要返回值。選擇的方 式和排序火車時(shí)刻信息可使用查表的方法來解決。表格如下選擇提示輸出結(jié)果1按開車時(shí)間排序,請(qǐng)選擇:1輸出選擇1的排序結(jié)果2按起點(diǎn)做為主關(guān)鍵字、開車時(shí)間做為次關(guān)鍵字 排序,請(qǐng)選擇:2輸出選擇2的排序結(jié)果輸入其他選擇時(shí)(即不是1或2),輸出“輸入錯(cuò)誤!請(qǐng)重新選擇!代碼參見sort函數(shù)。6)view模塊該函數(shù)是要輸出用戶錄入的火車時(shí)刻信息,不需要返回值。代碼參見view函數(shù)。7)創(chuàng)新設(shè)計(jì)部分通過請(qǐng)教老師和查閱資料,使用了 SetColor函數(shù),使得輸出的數(shù)據(jù)加

6、上了顏 色,變得更加醒目,更加具有吸引力。同時(shí),使用了 system("cls")語句,實(shí)現(xiàn)了 清除屏幕數(shù)據(jù)的功能,使得程序運(yùn)行界面變得簡潔。代碼參見SetColor函數(shù)。3、設(shè)計(jì)中的主要困難及解決方案在最開始的設(shè)計(jì)中只能夠錄入自己定義的火車時(shí)刻信息個(gè)數(shù), 且無法實(shí)現(xiàn)用戶 隨時(shí)停止錄入的功能。經(jīng)過自己的修改和完善,使用變量 m統(tǒng)計(jì)用戶錄入的火車時(shí) 刻信息個(gè)數(shù),實(shí)現(xiàn)了用戶任意錄入火車時(shí)刻信息個(gè)數(shù);通過 if判斷條件判斷錄入 車次是否為0,實(shí)現(xiàn)了用戶隨時(shí)停止錄入的功能。4、你所設(shè)計(jì)的程序最終完成的功能1)說明你編制的程序能完成的功能用戶通過不同的選項(xiàng),實(shí)現(xiàn)對(duì)火車票時(shí)刻信息的錄入

7、、查詢、統(tǒng)計(jì)、排序、瀏覽。2)準(zhǔn)備的測試數(shù)據(jù)及運(yùn)行結(jié)果f h I * C:Prog ram FiilesMicrosoft Visual Stud i o My P roj erts «a jI a I aD e bugla lalala. exe血主菜單J- J* 7 JJTJJJJ J0選選帚$0終開A 入 LA ;_ 輔2:3輸:5輸皿輸圭冃r3土月亢主冃八主月L8主月詣主L2土月次 霹理+月主Rn冃 .ll:4 lTl 管:選; 息 蔥心息 亠一-m-豆一一亠一一回一耳車車選 A$±±$w 用火火火火火 迎曇統(tǒng)排蚩 歡-¥1 2 4 5車器車爵選

8、 火WWMHS 火火火火 詢計(jì)迎書統(tǒng)歡單 窠: '土:: 充睪睪/2-4HLTJ- :Mln “ 系選選>i 理請(qǐng)請(qǐng)®謂 管:選: 息息息心息 亠一一耳一目一一巳=實(shí)耳"C:Program FillesMiCTOsoft Visual StudioMyProjectslalahIaiDebuglahlah.exe"覆入查詢終點(diǎn)1獲 起點(diǎn) 終點(diǎn)起點(diǎn)終占請(qǐng)選擇:2:開車時(shí)間到達(dá)時(shí)間開車時(shí)間到達(dá)時(shí)間票價(jià)票價(jià)菜 1 2 4 5 主3:選選 理請(qǐng)請(qǐng)請(qǐng) 管<«=: 自心自 心息 |5<心息 言営目一一巳亠一一 R=R 車訴車器選 用火火火火

9、火> 煲黑務(wù)岀 s_n 歡回I. "CPragram FilesMiCTO5Qft Visual StudioMyProjectsMlakIaDebughllah,exe"票價(jià)票價(jià)票價(jià)到達(dá)時(shí)間到達(dá)時(shí)間到達(dá)時(shí)間,=I 回*ttlt"開車時(shí)間開車時(shí)間開三時(shí)間S- 菜 1 2 d- B 壬3 二二: 系選選:烹 理請(qǐng)請(qǐng)s#il K :逮”; 心息息心 號(hào)_目一一e-1-5;亠-忌気L終點(diǎn)的一的mm1充充點(diǎn)點(diǎn)養(yǎng)1請(qǐng)?zhí)燔嚻瘘c(diǎn)起點(diǎn)車次車次擊訴車器選 次火WWWS 車用JP火火火火, 的歡津一 天一 為一 點(diǎn)-起一 I 'C:Program FilesMiCTOS

10、Qft Visual StudioMyProject5lalalaIaDebughlalah.exeHA請(qǐng)選廳2票價(jià)票價(jià)到達(dá)時(shí)間到達(dá)時(shí)間車次起點(diǎn)終點(diǎn)開車時(shí)間單; 1 '士 充睪睪 zz-in- 3 二. 1-T. 系星.選選 理請(qǐng)謂請(qǐng) 管<閻. 息息息 心息舊”Bi-aSJ di J JI是票“ 聲訴車熱選 次火WWW請(qǐng) 車用火火火火火* 卑務(wù)出 每迎養(yǎng)一統(tǒng)排蚩 的歡 臺(tái)一 邢一、一 點(diǎn)一半: "C:Program FilesXMiCTOsoft Visual StudioMyPrqjertsldilahIaDebughlalah.exe"遺開牢吋間排序進(jìn)選蜃

11、1按餌股境圭關(guān)te#.莽車時(shí)間做為我關(guān)鍵字排序,請(qǐng)選擇:乞 倉”車時(shí)迥港序J&:亠"*4執(zhí)羊次起點(diǎn) 算點(diǎn) 開車時(shí)間到達(dá)時(shí)間票價(jià)車器車熱選 火WW44請(qǐng) 用火火火火火, 呀詢計(jì)掘?qū)?迎nll排幫 歡單M-'士 充睪革(¥? zz-lJUJ - =_!. 系選選.選選 理請(qǐng)請(qǐng)請(qǐng) 管;遜: 自0息心息 亠一豆一一母=亠一一R亠一一Rr-"C:Program FillesMicrosoft Visual StudioMyProject5lalahIaDebughlalah.exe票價(jià)遽開豐時(shí)間*蒔.:按起貢就境圭關(guān)柚黑 笄車時(shí)間做為愧關(guān)鍵字排険 詩選擇.2

12、 備起點(diǎn)做為主關(guān)華次起點(diǎn)FSB開車嘶一卑-12 百 5 'ZL- 充睪POF J ? zz-iJ4J - -r-r.二. 系選選:選選 理請(qǐng)請(qǐng)請(qǐng) 管遜: 自.3自心S心自心 言言宣蘭巳_5.- 票車器車訴選 火請(qǐng) 用火火火火火, 呀詢計(jì)脣岀 迎nlKg排蚩 歡-車次 起點(diǎn) 終點(diǎn) 開車時(shí)間到達(dá)時(shí)間票價(jià)B 'GProgram Files' Microsoft Visua StudioMVIyProjects lalalalaDebug' aldhla.exe*單菜 1 2 4 5 '土, ¥¥ $¥-:_“、3 二.L_ 、 系

13、曙:選選 膽育主冃CM冃主冃 llrJTFTl- 菅:選; 息心息;!心息 亠_=目登一一亠一豆一耳 車訴車訴選 用火火火X火 迎畫統(tǒng)排遛- 導(dǎo)r "C:Program FilesMicrosoft Visual StudioMyProjects;> lalalaIaDebuglalahla.exeWF到達(dá)時(shí)間開車時(shí)間單 菜 1 2 4 5 '土 : E : £薩-二二.3 二 is 選選 理lix月主S-H冃v-1 T1L- 管:選.; 息息息心息 亠一一母気亠一一巳亠一一 R=R 車訴車器選 用火火火火火 煲器務(wù)岀 迎魯統(tǒng)排常 歡. I wC:Progra

14、m FilesMicrosoft Visual Stud i o M y P rqj ects -Jdi ia I a I aD e bugh lalah, exe"遼理車次查詢.諂選S-: 1 按照起點(diǎn)和塚點(diǎn)晝?cè)冋?qǐng)選擇:2請(qǐng)聾入查詢起點(diǎn):壽*入查詢終點(diǎn)p TC;ProgramFileXMicrosoft Visusl StudioMyProj£“5為怙山1曰口訪口百 e -3 ala.exe"勰翻體龜野霸寸間畛次關(guān)鍵字排険情選扱a-釆 1 2 4- 5 '士 充 '睪睪 系烹:選選 理主冃tkrtffHl冃主冃 -LJ- T 11 I tj.,

15、1 TP 管:邂: 息息 心息 亠一一刊=£*鬲亠一一B一一 R 車薛車器選 靈WWHW請(qǐng) -:-一用火火火火火. 一冕器賽岀 迎排幫%p 'C:Program File5Micro5oft Viisusl Stud ioM/Project? I a Id I a I aD e t)ugh h lai a .exe"1請(qǐng)選擇雷2追子犍 序關(guān)單S-1 ; ! 主'$:塞 系烹.選選 厘圭冃青冃主冃 管:邂; 息息息 flnl心息 蘭£-_&-_% 亠一一S-1一一 E車器車訴選 靈WWW請(qǐng) 1臾火火火火* 一晃器隹岀 迎黍統(tǒng)排製 欠Press

16、 ariy ke to continue三、程序清單1) main函數(shù)/預(yù)定義處理#i nclude<iostream.h>#i nclude<stri ng.h>#i ncludevwi ndows.h> const int N=100;/結(jié)構(gòu)體聲明struct time in putchar trainnu m10;char startp10;char e ndp10;char startt10;char e ndt10;double price;tN,who;定義結(jié)構(gòu)體數(shù)組與結(jié)構(gòu)體變量/函數(shù)聲明void menu();void in put();void s

17、earch();void statistics();void sort();void view();void SetColor( un sig ned short ,un sig ned short);/主函數(shù)void mai n()menu();顯示系統(tǒng)主界面int num;cin»num;for(; nu m!=0;)system("cls");清除屏幕數(shù)據(jù)switch( num)case 1:i nput();break;錄入火車時(shí)刻信息case 2:search();break;查詢火車時(shí)刻信息case 3:statistics();break;統(tǒng)計(jì)火車車

18、次case 4:sort();break;排序火車時(shí)刻信息case 5:view();break;瀏覽火車時(shí)刻信息case 0:break;退出系統(tǒng)default:cout<<"輸入錯(cuò)誤!請(qǐng)重新選擇!"<<endl;break;menu();cin>>num;2) menu函數(shù)void me nu() 顯示系統(tǒng)主界面SetColor(15,0);數(shù)據(jù)是白色,背景是黑色cout«"歡迎使用火車票信息管理系統(tǒng)主菜單"<<e ndl;cout«"錄入火車時(shí)刻信息,請(qǐng)選擇:"

19、vvflush;SetColor(10,0); cout<<"1"<<e ndl;數(shù)據(jù)是綠色,背景是黑色SetColor(15,0);cout«"查詢火車時(shí)刻信息,請(qǐng)選擇:"vvflush;SetColor(10,0); cout<<"2"<<e ndl;SetColor(15,0);cout«"統(tǒng)計(jì)火車車次,請(qǐng)選擇:"vvflush;SetColor(10,0); cout<v"3"v<e ndl;SetColor

20、(15,0);cout«"排序火車時(shí)刻信息:請(qǐng)選擇:IIvvflush;SetColor(10,0);cout<v"4"v<e ndl;SetColor(15,0);cout«"瀏覽火車時(shí)刻信息:請(qǐng)選擇:IIvvflush;SetColor(10,0);cout<<"5"<<e ndl;SetColor(15,0);cout«"退出,請(qǐng)選擇:"vvflush;SetColor(12,0);數(shù)據(jù)是紅色,背景是黑色cout<<"0&

21、quot;<<e ndl;SetColor(14,0);數(shù)據(jù)是黃色,背景是黑色3) in put 函數(shù)void in put()錄入火車時(shí)刻信息for(int i=0;i<N;i+)SetColor(12,0); cout<<"輸入車次為0時(shí)結(jié)束錄入!"<<endl;SetColor(15,0); cout<<"請(qǐng)輸入車次:"<<e ndl;SetColor(14,0); cin> >ti.trai nnum; cout<<flush;if(strcmp(ti.tr

22、ai nn um,"0")=0)break;SetColor(15,0); cout<<"請(qǐng)輸入起點(diǎn):"<<e ndl;SetColor(14,0); cin>>ti.startp; cout<<flush;SetColor(15,0); cout<<"請(qǐng)輸入終點(diǎn):"<<e ndl;SetColor(14,0); cin>>ti.endp; cout<<flush;SetColor(15,0); cout<<"請(qǐng)輸入開

23、車時(shí)間:"<<e ndl;SetColor(14,0); cin>>ti.startt; coutvvflush;SetColor(15,0); cout<<"請(qǐng)輸入到達(dá)時(shí)間:"<<e ndl;SetColor(14,0); cin>>ti.endt; cout<<flush;SetColor(15,0); cout<<"請(qǐng)輸入票價(jià):"<<e ndl;SetColor(14,0); cin>>ti.price; cout<<f

24、lush;m+;統(tǒng)計(jì)錄入次數(shù)4) search 函數(shù)void search()查詢火車時(shí)刻信息SetColor(15,0); cout<<"按照車次查詢,請(qǐng)選擇:"<<flush;SetColor(10,0); cout<<"1"<<e ndl;SetColor(15,0); cout<<"按照起點(diǎn)和終點(diǎn)查詢,請(qǐng)選擇:"<<flush;SetColor(10,0); cout<<"2"<<e ndl;int a,p=0;

25、SetColor(14,0); cin»a; cout<<flush;if(a=1)SetColor(15,0); cout<<"請(qǐng)輸入查詢車次:"<<e ndl;SetColor(14,0); cin>>who.trainnum; cout<<flush;for(int i=0;i<m;i+)if(strcmp(who.trai nnu m,ti.trai nnum)=0)p=1;SetColor(15,0);cout«"車次"vv"t"vv&qu

26、ot; 起點(diǎn)"vv"t"vv" 終點(diǎn)"<<"t"coutvv"開車時(shí)間"vv"t"vv" 到達(dá)時(shí)間"vv"t"vv" 票價(jià)"<<endl;SetColor(9,0);數(shù)據(jù)是藍(lán)色,背景是黑色cout<<ti.trai nnu m<v"t"vvti.startpvv"t"v<ti.e ndp«"t" cout<

27、;vti.starttvv"t"vv"t"vvti.e ndt<<"t"<<"t"<<ti.price<<e ndl;if(p=0)SetColor(12,0);cout«"無此車次!"<<endl;else if(a=2)SetColor(15,0); cout<<"請(qǐng)輸入查詢起點(diǎn):"<<e ndl;SetColor(14,0); cin>>who.startp; co

28、utvvflush;SetColor(15,0); cout<<"請(qǐng)輸入查詢終點(diǎn):"<<e ndl;SetColor(14,0); cin> >who.e ndp; cout<<flush;for(int i=0;i<m;i+)if(strcmp(who.startp,ti.startp)=0&&strcmp(who.e ndp,ti.e ndp)=0) p=1;SetColor(15,0);coutvv"車次"<<"t"<<" 起

29、點(diǎn)"<<"t"<<" 終點(diǎn)"<<"t"coutvv"開車時(shí)間"vv"t"vv" 到達(dá)時(shí)間"vv"t"vv" 票價(jià)"vvendl; SetColor(9,0);coutvvti.trai nn umvv"t"vvti.startpvv"t"vvti.e ndpvv"t" coutvvti.starttvv"t"vv

30、"t"vvti.e ndtvv"t"vv"t"vvti.pricevve ndl;if(p=0)SetColor(12,0);cout«"無此車次!"<<endl;elseSetColor(12,0);coutvv"輸入錯(cuò)誤!請(qǐng)重新選擇!"<<endl;5) statistics 函數(shù)void statistics。/統(tǒng)計(jì)火車車次SetColor(15,0); cout<<"按起點(diǎn)統(tǒng)計(jì)每日的車次數(shù),請(qǐng)選擇:"vvflush;Set

31、Color(10,0); cout<<"1"<<e ndl;SetColor(15,0); cout<<"按終點(diǎn)統(tǒng)計(jì)每日的車次數(shù),請(qǐng)選擇:"<<flush;SetColor(10,0); cout<<"2"<<e ndl;int a,p=0;SetColor(14,0); cin»a; cout<<flush;if(a=1)SetColor(15,0); cout<<"請(qǐng)輸入統(tǒng)計(jì)起點(diǎn):"<<e nd

32、l;SetColor(14,0); cin>>who.startp; cout<<flush;int n=0;for(int i=0;i<m;i+)n+;SetColor(15,0);coutvv"車次"vv"t"vv"起點(diǎn)"vv"t"vv"終點(diǎn)"vv"t"vv"開車時(shí)間" coutvv"t"vv"到達(dá)時(shí)間"<<"t"<<"票價(jià)&qu

33、ot;<<endl;SetColor(9,0);cout<<ti.trai nn um<v"t"vvti.startpvv"t"v<ti.e ndp«"t"cout<vti.starttvv"t"vv"t"vvti.e ndt<<"t"<<"t"<<ti.price<<e ndl;SetColor(15,0); cout<<" 起點(diǎn)為&

34、quot;vvflush;SetColor(10,0); cout<<who.startp<<flush;SetColor(15,0); cout<<"的每日車次數(shù)是"<<flush;SetColor(12,0); cout<< n< <flush;SetColor(15,0); cout<<"次"<<e ndl;else if(a=2)SetColor(15,0); cout<<" 請(qǐng)輸入統(tǒng)計(jì)終點(diǎn):"<<e ndl

35、;SetColor(14,0); cin> >who.e ndp; cout<<flush;int n=0;for(int i=0;i<m;i+)if(strcmp(who.e ndp,ti.e ndp)=0)n+;SetColor(15,0);coutvv"車次"<<"t"<<" 起點(diǎn)"<<"t"<<" 終點(diǎn)"<<"t"<<" 開車時(shí)間" cout<

36、;<"t"<<"到達(dá)時(shí)間"vv"t"vv"票價(jià)"vvendl;SetColor(9,0);cout<<ti.trai nnum vv"t"v<ti.startpvv"t"vvti.e ndp<<"t" cout<vti.starttvv"t"vv"t"v<ti.e ndt<v"t"vv"t"vvti.pricev

37、<e ndl;SetColor(15,0); cout<<" 終點(diǎn)為"vvflush;SetColor(10,0); cout<<who.endpvvflush;SetColor(15,0); cout<<"的每日車次數(shù)是"<<flush;SetColor(12,0); cout<<n<<flush;SetColor(15,0); cout<<"次"<<e ndl;elseSetColor(12,0);coutvv"輸入錯(cuò)誤

38、!請(qǐng)重新選擇!"<<endl;6) sort函數(shù)void sort()/排序火車時(shí)刻信息SetColor(15,0); cout<<"按開車時(shí)間排序,請(qǐng)選擇:"<<flush;SetColor(10,0); cout<<"1"<<e ndl;SetColor(15,0); cout<<"按起點(diǎn)做為主關(guān)鍵字、開車時(shí)間做為次關(guān)鍵字排序,cout«"請(qǐng)選擇:"vvflush;SetColor(10,0); cout<<"

39、;2"<<e ndl;int a;SetColor(14,0); cin»a; cout<<flush;if(a=1)for(int i=0;i<m-1;i+)for(i nt j=0;j<m-1-i;j+)who=tj;tj=tj+1;tj+1=who;SetColor(15,0);coutvv"按開車時(shí)間排序后是:"<<endl;cout«"車次"vv"t"v<"起點(diǎn)"vv"t"v<" 終點(diǎn)&

40、quot;vv"t"v<" 開車時(shí)間"coutvv"t"vv"到達(dá)時(shí)間"<<"t"<<"票價(jià)"<<endl;for(i=0;i<m;i+)SetColor(9,0);cout<<ti.trai nn um<v"t"vvti.startpvv"t"v<ti.e ndp«"t"cout<vti.starttvv"t"

41、;vv"t"vvti.e ndt<<"t"<<"t" cout<<ti.price<<e ndl;else if(a=2)for(int i=0;i<m-1;i+)for(i nt j=0;j<m-1-i;j+)if(strcmp(tj.startp,tj+1.startp)>0)who=tj;tj=tj+1;tj+1=who;for(i=0;i<m-1;i+)for(i nt j=0;j<m-1-i;j+)who=tj;tj=tj+1; tj+1=who;SetColor(15,0);coutvv"按起點(diǎn)做為主關(guān)鍵字、開車時(shí)間做為次關(guān)鍵字排序后是:"<<endl;cout«"車次"vv"t"v<" 起點(diǎn)"vv"t"v<" 終點(diǎn)"vv"t"v<" 開車時(shí)間" coutvv"t"vv"到達(dá)時(shí)間"<<&q

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(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ǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論