中國道路交通網(wǎng)絡(luò)信息查詢系統(tǒng)_第1頁
中國道路交通網(wǎng)絡(luò)信息查詢系統(tǒng)_第2頁
中國道路交通網(wǎng)絡(luò)信息查詢系統(tǒng)_第3頁
中國道路交通網(wǎng)絡(luò)信息查詢系統(tǒng)_第4頁
中國道路交通網(wǎng)絡(luò)信息查詢系統(tǒng)_第5頁
已閱讀5頁,還剩29頁未讀, 繼續(xù)免費閱讀

下載本文檔

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

文檔簡介

1、中國道路交通網(wǎng)絡(luò)信息查詢系統(tǒng)【問題描述】出于不同的目的的旅客對交通工具有不同的要求。例如,因 公出差的旅客希望在旅途中的時間盡可能短,出門旅游的游客則 期望旅費盡可能省,而老年旅客則要求中轉(zhuǎn)次數(shù)最少。編制一個 全國城市間的交通咨詢程序,為旅客提供兩種或三種最優(yōu)決策的 交通咨詢?!鞠到y(tǒng)要求】(1) 提供對城市信息進(jìn)行編輯(如:添加或刪除)的功能。(2)城市之間有兩種交通工具:火車和飛機。提供對列車時刻表和飛機航班進(jìn)行編輯(增設(shè)或刪除)的功能。(3)提供兩種最優(yōu)決策:最快到達(dá)或最省錢到達(dá)。全程只考慮 一種交通工具;(4)旅途中耗費的總時間應(yīng)該包括中轉(zhuǎn)站的等候時間;(5)咨詢以用戶和計算機的對話方式

2、進(jìn)行。由用戶輸入起始站、 終點站、最優(yōu)決策原則和交通工具,輸出信息:最快需要 多長時間才能到達(dá)或者最少需要多少旅費才能到達(dá),并詳 細(xì)說明依次于何時乘坐哪一趟列車或哪一次班機到何地?!境绦蚪Y(jié)構(gòu)圖】算法分析】1新建數(shù)據(jù)void creat_data1() / 新建數(shù)據(jù) int i;printf("請輸入添加火車個數(shù) : " );scanf( "%d",&t);for (i=1;i<=t;i+)printf("請輸入添加火車列次 : " );scanf( "%s",hci.hnum); printf( &q

3、uot;n" );printf("n 請輸入始站 :" );scanf("%s",hci.kname); printf("n"printf(" 請輸入終站 :" );scanf("%s",hci.dname); printf("n"printf(" 請輸入開車時間 :" );scanf("%s",hci.ktime); printf("n"printf(" 請輸入到站時間 :" );sc

4、anf("%s",hci.dtime); printf("n"printf(" 請輸入經(jīng)歷時間 :" );scanf("%s",hci.ltime); printf("n"print();2. 添加數(shù)據(jù)void add1() / 添加數(shù)據(jù) char ch;doprintf( "請輸入添加火車列次 : " );scanf( "%s" ,hct+1.hnum); printf("n"printf("n 請輸入始站 :"

5、);scanf("%s",hct+1.kname); printf("n"printf(" 請輸入終站 :" );scanf( "%s",hct+1.dname); printf( "n" );printf( " 請輸入開車時間 :" );scanf("%s",hct+1.ktime); printf("n"printf(" 請輸入到站時間 :" );scanf("%s",hct+1.dtime)

6、; printf("n"printf(" 請輸入經(jīng)歷時間 :" );scanf("%s",hct+1.ltime); printf("n"t+;printf(" 是否繼續(xù)添加 y/n:" );getchar();ch=getchar();printf("n" ); while (ch= 'y' );print();3. 刪除數(shù)據(jù)void delet1() / 刪除數(shù)據(jù)char num110;int i,j,count=0;printf( " 輸入想要

7、刪除的火車列次 "); scanf( "%s" ,num1);for (i=1;i<=t;i+)if (strcmp(num1,hci.hnum)=0)for (j=i;j<t+1;j+)hcj=hcj+1;count+;t-;if (count=0) printf("沒有列車信息! ");else print();4. 迪杰斯特拉算法void ShortwstPath( int num) /* 迪杰斯特拉算法最短路徑函數(shù) */ int v,w,i,t; int final25;int min;for (v=0;v<25;+v

8、) /* 初始化 */ finalv=0; /* 標(biāo)志數(shù)組初始化 */Dv=G.arcsnumv.adj;for (w=0;w<25;+w) Pvw=0; /* 設(shè)空路徑 */ if (Dv<20000) /*v,v0 間有邊存在 */ Pvnum=1;PVV=1;/*到V的最短路徑上包含V0及V*/ /*if*/Dnum=0;finalnum=1; /* 初始化,V0頂點屬于 B集*/*開始主循環(huán),每次求得 vO到某個V頂點的最短路徑,并加V到B集 */for (i=0;i<25;+i)/* 其余 G.vexnum-1 各頂點 */min=20000;for (w=0;w&

9、lt;25;+w)if (!finalw) /*w 頂點在 V-S 中 */if (Dw<min)v=w;min=Dw;/*w 頂點離 vO更近 */finalv=1; /*離vO頂點最近的v加入B*/for (w=0;w<25;+w) /* 更新當(dāng)前最短路徑及距離 */if (!finalw&&(min+G.arcsvw.adj)<Dw)Dw=min+G.arcsvw.adj; /* 修改 D和 P數(shù)組 */for (t=O;t<25;t+)Pwt=Pvt;Pww=1; /*if*/ /*for*/【程序測試】 建立如下圖所示的全國交通圖:O. 哈爾濱

10、 1 . 長春 2. 沈陽 3. 大連 4. 天津 5. 北京 6. 徐州 7. 呼和浩特 8. 蘭州 9. 烏魯木齊 1O. 西寧 11. 西安 12. 鄭州 13. 上海 14. 南昌 15. 福州 16. 株洲 17. 武漢18.廣州19.深圳20.柳州21.貴陽 22.南寧23.成都24.昆明96685114513732266956746755111231984265153423179671100325409902241614367622675181401918920242'1 704測試結(jié)果截圖:列次 始站 終站 開車 到站 歷時津京和寧天北呼西特浩沈天北呼蘭0 3 H 03

11、 : 4/ 09:14蘭1:0 0 00 0 3 0 0 :0 04 6 6 111134.51.523:006.53:0022最短路徑從沈陽到西寧最短距離2870m.沈陽> 天津> 北京>呼和浩特> 蘭州 > 西壬 火車時刻表:主菜單zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzazzzzzzzz頁f八交通信息網(wǎng)Debug交通信息網(wǎng)主菜單歡迎進(jìn)入中同道路交通網(wǎng)絡(luò)信息查詢系統(tǒng)I銅艮務(wù)項目2 乘坐火車3 乘坐飛機4退岀請輸入序號選擇相應(yīng)操作,扁表3 退出vri '、列次始站終站k89長晝k89“ 1 «

12、;-> ”' W'哈爾濱u78沈陽u78沈陽長春67沈陽-JL-'jtX v A-L»:1113 3 6ca佇交通信息網(wǎng)Debug交通信息網(wǎng)請輸入到站時|可:4:00 請輸入經(jīng)歷時間:2 是否繼續(xù)添加y/n:n時刻表站請輸入序號選擇相應(yīng)操作:15 5 5 5 5 5 55 5 5 5 52222224412 2 2 2 2 23 6 6 6 9 9表表賓12 3 432 3S980 0 0 0 0 00 0 0 0 0 0f9 8 8 8 7 78 7 7 7 6 6 k u u u . J . JSFB0 0 0 0 0 00 3 3 3 3 313

13、3 3 6 6嘗i8 8 7 7 8 8 7 A7766776 Suu J J u u q那00000000300333333 :1233669910 0 00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4 4 6 346699111操列應(yīng)車時濱丟春陽星春陽陽看連陽 長沈沈長盒【源代碼】#include "string.h" #include "stdio.h" struct hcarchar hnum10; char kname10;char dname10;char ktime10;char dtime10; char ltime10;

14、hc60= "k89" , " 哈爾濱 ", " 長春", "1:00" , "3:00" , "2" , "k89" ," 長春 "," 哈爾濱 ","1:00" ,"3:00" ,"2" ,"u78" ," 長春 "," 沈陽","3:30" ,"6:00"

15、; ,"2.5" ,"u78" ," 沈陽 "," 長春","3:30" ,"6:00" ,"2.5" ,"j67" ," 沈陽 "," 大連","6:30" ,"9:00" ,"2.5" , "j67" ," 大連 "," 沈陽","6:30" ,"

16、;9:00" ,"2.5" ,"v78" ," 沈陽 "," 天津","9:30" ,"14:00" ,"4.5" , "v78" ," 天津 "," 沈陽","9:30" ,"14:00" ,"4.5" , "g67" ," 天津 "," 北京","14:3

17、0" ,"16:00" ,"1.5" , "g67" ," 北京 "," 天津","14:30" ,"16:00" ,"1.5" , "f67" , " 北京 ", " 呼和浩特 ", "f67" , " 呼和浩特 ", " 北京 ", "j56" , " 呼和浩特 "

18、, " 蘭州 ", "j56" , " 蘭州 ", " 呼和浩特 ", "v67" , " 蘭州 ", " 烏魯木齊 ", "v67" , " 烏魯木齊 ", " 蘭州 ","16:30" ,"23:00" ,"6.5" ,"16:30" ,"23:00" ,"6.5" ,&qu

19、ot;1:00" ,"3:00" ,"2" ,"1:00" ,"3:00" ,"2" ,"1:00" ,"3:00" ,"2" ,"1:00" ,"3:00" ,"2" , "f46" , " 蘭州 ", "f46" , " 西寧 ", "d49" , " 天

20、津 ", "d49" , " 徐州 ", "c44" , " 徐州 ", "c44" , " 鄭州 ", "h47" , " 鄭州 ", "h47" , " 北京 ", "d46" , " 鄭州 ", "d46" , " 西安 "," 西寧 ", "1:00""

21、; 蘭州 ", "1:00"" 徐州 ", "1:00"" 天津 ", "1:00"" 鄭州 ", "1:00"" 徐州 ", "1:00"" 北京 ", "1:00"" 鄭州 ", "1:00"" 西安 ", "1:00"" 鄭州 ", "1:00"

22、; "3:00" , "2" , "3:00" , "2" , "3:00" , "2" , "3:00" , "2" , "3:00" , "2" , "3:00" , "2" , "3:00" , "2" , "3:00" , "2" , "3:00" ,

23、 "2" , "3:00" , "2" ,"v46" ," 西安 "," 蘭州","1:00" ,"3:00" ,"2""v46" ," 蘭州 "," 西安","1:00" ,"3:00" ,"2""s45" ," 徐州 "," 上海",&

24、quot;1:00" ,"3:00" ,"2""s45" ," 上海 "," 徐州","1:00" ,"3:00" ,"2""t84" ," 上海 "," 南昌","1:00" ,"3:00" ,"2""t84" ," 南昌 "," 上海",&quo

25、t;1:00" ,"3:00" ,"2""f43" ," 南昌 "," 株洲","1:00" ,"3:00" ,"2""f43" ," 株洲 "," 南昌","1:00" ,"3:00" ,"2""i45" ," 株洲 "," 武漢","1

26、:00" ,"3:00" ,"2""i45" ," 武漢 "," 株洲","1:00" ,"3:00" ,"2""d53" ," 武漢 "," 鄭州","1:00" ,"3:00" ,"2""d53" ," 鄭州 "," 武漢","1:00

27、" ,"3:00" ,"2""f67" ," 株洲 "," 廣州","1:00" ,"3:00" ,"2""f67" ," 廣州 "," 株洲","1:00" ,"3:00" ,"2""h76" ," 廣州 "," 深圳","1:00&qu

28、ot; ,"3:00" ,"2""h76" ," 深圳 "," 廣州","1:00" ,"3:00" ,"2""s45" ," 株洲 "," 貴陽","1:00" ,"3:00" ,"2""s45" ," 貴陽 "," 株洲","1:00"

29、 ,"3:00" ,"2""o56" ," 株洲 "," 柳州","1:00" ,"3:00" ,"2""o56" ," 柳州 "," 株洲","1:00" ,"3:00" ,"2""d65" ," 貴陽 "," 柳州","1:00" ,&

30、quot;3:00" ,"2""d65" ," 柳州 "," 貴陽","1:00" ,"3:00" ,"2""r44" ," 南寧 "," 柳州","1:00" ,"3:00" ,"2""r44" ," 柳州 "," 南寧","1:00" ,&quo

31、t;3:00" ,"2""f56" ," 貴陽 "," 成都","1:00" ,"3:00" ,"2""f56" ," 成都 "," 貴陽","1:00" ,"3:00" ,"2""g06" ," 西安 "," 成都","1:00" ,"3

32、:00" ,"2""g06" ," 成都 "," 西安","1:00" ,"3:00" ,"2""d97" ," 貴陽 "," 昆明","1:00" ,"3:00" ,"2""d97" ," 昆明 "," 貴陽","1:00" ,"3:00

33、" ,"2""d67" ," 成都 "," 昆明","1:00" ,"3:00" ,"2""d67" ," 昆明 "," 成都","1:00" ,"3:00" ,"2", , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ;struct planechar p

34、num10;char kname10;char dname10;char ktime10;char dtime10;char ltime10;pl60= "k89" ," 哈爾濱 ", " 長春", "1:00""3:00""2" , "k89" ,"u78" ,"u78" , "j67" , "j67" , "v78" , "v78"

35、, "g67" , "g67" ," 長春 ", " 長春 ", " 沈陽 ", " 沈陽 ", " 大連 ", " 沈陽 ", " 天津 ", " 天津 ", " 北京 "," 哈爾濱 ", "1:00"" 沈陽", " 長春", " 大連", " 沈陽",

36、 " 天津", " 沈陽", " 北京", " 天津","3:30""3:30""6:30""6:30""9:30""9:30""14:30""14:30""3:00""6:00""6:00""9:00""9:00""14:00""

37、;14:00""16:00""16:00""2" ,"2.5" ,"2.5" , "2.5" , "2.5" , "4.5" , "4.5" , "1.5" , "1.5" , "f67" ," 北京 "," 呼和浩特 ", "f67" ," 呼和浩特", "

38、 北京", "j56" ," 呼和浩特", " 蘭州", "j56" ," 蘭州 "," 呼和浩特 ", "v67" ," 蘭州 "," 烏魯木齊 ", "v67" ," 烏魯木齊", " 蘭州","16:30" ,"23:00" ,"6.5" ,"16:30" ,&q

39、uot;23:00" ,"6.5" ,"1:00" ,"3:00" ,"2" ,"1:00" ,"3:00" ,"2" ,"1:00" ,"3:00" ,"2" ,"1:00" ,"3:00" ,"2" , "f46" , "f46" , "d49" , "d

40、49" , "c44" , "c44" , "h47" , "h47" , "d46" , "d46" , "v46" , "v46" , "s45" , "s45" , "t84" , "t84" ," 蘭州 "," 西寧","1:00" ,"3:00" ,"

41、;2" ," 西寧 "," 蘭州","1:00" ,"3:00" ,"2" ," 天津 "," 徐州","1:00" ,"3:00" ,"2" ," 徐州 "," 天津","1:00" ,"3:00" ,"2" ," 徐州 "," 鄭州","

42、;1:00" ,"3:00" ,"2" ," 鄭州 "," 徐州","1:00" ,"3:00" ,"2" ," 鄭州 "," 北京","1:00" ,"3:00" ,"2" ," 北京 "," 鄭州","1:00" ,"3:00" ,"2" ,&q

43、uot; 鄭州 "," 西安","1:00" ,"3:00" ,"2" ," 西安 "," 鄭州","1:00" ,"3:00" ,"2" ," 西安 "," 蘭州","1:00" ,"3:00" ,"2" ," 蘭州 "," 西安","1:00"

44、,"3:00" ,"2" ," 徐州 "," 上海","1:00" ,"3:00" ,"2" ," 上海 "," 徐州","1:00" ,"3:00" ,"2" ," 上海 "," 南昌","1:00" ,"3:00" ,"2" ," 南昌 &quo

45、t;," 上海","1:00" ,"3:00" ,"2" ,*/ "f43" , " 南昌 ", "f43" , " 株洲 ", "i45" , " 株洲 ", "i45" , " 武漢 ", "d53" , " 武漢 ", "d53" , " 鄭州 ", "f67&q

46、uot; , " 株洲 ", "f67" , " 廣州 ", "h76" , " 廣州 ", "h76" , " 深圳 ", "s45" , " 株洲 ", "s45" , " 貴陽 ", "o56" , " 株洲 ", "o56" , " 柳州 ", "d65" , "

47、; 貴陽 ", "d65" , " 柳州 ", "r44" , " 南寧 ", "r44" , " 柳州 ", "f56" , " 貴陽 ", "f56" , " 成都 ", "g06" , " 西安 ", "g06" , " 成都 ", "d97" , " 貴陽 ",

48、 "d97" , " 昆明 ", "d67" , " 成都 ", "d67" , " 昆明 ", int t; / 全局變量 typedef struct ArcCell int adj; char *info;ArcCell; /* 定義邊的類型 */ typedef struct VertexType int number;char *place;VertexType; /* 定義頂點的類型 typedef struct " 株洲","1:0

49、0" ,"3:00" ,"2" ," 南昌","1:00" ,"3:00" ,"2" ," 武漢","1:00" ,"3:00" ,"2" ," 株洲","1:00" ,"3:00" ,"2" ," 鄭州","1:00" ,"3:00" ,"

50、;2" ," 武漢","1:00" ,"3:00" ,"2" ," 廣州","1:00" ,"3:00" ,"2" ," 株洲","1:00" ,"3:00" ,"2" ," 深圳","1:00" ,"3:00" ,"2" ," 廣州","

51、1:00" ,"3:00" ,"2" ," 貴陽","1:00" ,"3:00" ,"2" ," 株洲","1:00" ,"3:00" ,"2" ," 柳州","1:00" ,"3:00" ,"2" ," 株洲","1:00" ,"3:00" ,&q

52、uot;2" ," 柳州","1:00" ,"3:00" ,"2" ," 貴陽","1:00" ,"3:00" ,"2" ," 柳州","1:00" ,"3:00" ,"2" ," 南寧","1:00" ,"3:00" ,"2" ," 成都",&qu

53、ot;1:00" ,"3:00" ,"2" ," 貴陽","1:00" ,"3:00" ,"2" ," 成都","1:00" ,"3:00" ,"2" ," 西安","1:00" ,"3:00" ,"2" ," 昆明","1:00" ,"3:00"

54、,"2" ," 貴陽","1:00" ,"3:00" ,"2" ," 昆明","1:00" ,"3:00" ,"2" ," 成都","1:00" ,"3:00" ,"2" VertexType vex25;ArcCell arcs2525;int vexnum,arcnum;MGraph; /* 定義圖的類型 */MGraph G; /*

55、 把圖定義為全局變量 */char*sa30= "a" ,"a" , "a" ,"a" ,"a" ,"a" ,"a" ,"a" ,"a" ,"a" ,"a" ,"a" ,"a" ,"a" ,"a" ,"a" , a", "a" , "a&q

56、uot; , "a" ,"a" , "a" , "a" , "a" , "a" , "a" ,"a" ,"a" ,"a" , "a" ;int longP2525;intD25;voidprint()intn;voidprinth();voidprintp();voidprint1();voidprint2();doprintf( "ttt 時刻表 n" )

57、;printf( "tn");printf("ttt1.火車時刻表 n" )printf("ttt2.飛機時刻表 n" )printf("ttt3.退出 n" );printf("tn");printf("請輸入序號選擇相應(yīng)操作: ");scanf( "%d",&n);switch (n)case 1:print1();printh();break ;case 2:print2();printp();break ;case 3:printf( &q

58、uot; 歡迎使用 n" ); break ; default : printf( "輸入錯誤 "); while (n!=3);void printh()int n;void creat_data1();void add1();void delet1();doprintf( "ttt 火車時刻表 n" );printf("tn");printf( "ttt1. 新建數(shù)據(jù) n" ) ;printf("ttt2.添加 n" );printf("ttt3.刪除 n" )

59、;printf( "ttt4. 退出 n" );printf("tn");printf("請輸入序號選擇相應(yīng)操作: ");scanf( "%d",&n);switch (n)case 1:creat_data1(); break ;case 2:add1(); break ;case 3:delet1(); break ;case 4:printf( " 歡迎使用 n" ); break ; default : printf( "輸入錯誤 "); while (n!=

60、4); void printp()int n;void creat_data2();void add2();void delet2();doprintf( "ttt 飛機時刻表 n" );printf("tn");printf( "ttt1. 新建數(shù)據(jù) n" ) ;printf("ttt2.添加 n" );printf("ttt3.刪除 n" );printf( "ttt4. 退出 n" );printf("tn");printf("請輸入序號選

61、擇相應(yīng)操作: ");scanf( "%d",&n);switch (n)case 1:creat_data2(); break ;case 2:add2(); break ;case 3:delet2(); break ;case 4:printf( " 歡迎使用 n" ); break ; default : printf( "輸入錯誤 "); while (n!=4);void print1()int i;printf( "tt 列次 始站 終站 開車 到站 歷時 n" );printf( &

62、quot;ttn" );for (i=0;i<58;i+)printf("tt %s%s %s %s %s %sn" ,hci.hnum,hci.kname,hci.dname,hci.ktime,hci.dtime,hci.l time);for (i=58;i<=(58+t);i+)printf("tt %s %s %s %s %s %sn" ,hci.hnum,hci.kname,hci.dname,hci.ktime,hci.dtime,hci.l time);printf(ttnn");void creat_da

63、ta1() / 新建數(shù)據(jù)int i;printf("請輸入添加火車個數(shù) : " );scanf( "%d",&t);for (i=1;i<=t;i+)printf("請輸入添加火車列次 : " );scanf("%s",hci.hnum); printf("n"printf("n 請輸入始站 :" );scanf("%s",hci.kname); printf("n"printf(" 請輸入終站 :"

64、);scanf("%s",hci.dname); printf("n"printf(" 請輸入開車時間 :" );scanf("%s",hci.ktime); printf("n"printf(" 請輸入到站時間 :" );scanf("%s",hci.dtime); printf("n"printf(" 請輸入經(jīng)歷時間 :" );scanf("%s",hci.ltime); printf(&qu

65、ot;n"/sum_stu();print();void add1() / 添加數(shù)據(jù)char ch;doprintf( "請輸入添加火車列次 : " );scanf( "%s",hct+1.hnum); printf("n" );printf("n 請輸入始站 :" );scanf( "%s",hct+1.kname); printf("n" );printf(" 請輸入終站 :" );scanf( "%s",hct+1.dn

66、ame); printf("n" );printf( " 請輸入開車時間 :" );scanf("%s",hct+1.ktime); printf("n"printf(" 請輸入到站時間 :" );scanf("%s",hct+1.dtime); printf("n"printf(" 請輸入經(jīng)歷時間 :" );scanf("%s",hct+1.ltime); printf("n"t+;printf

67、(" 是否繼續(xù)添加 y/n:" );getchar();ch=getchar();printf("n" ); while (ch= 'y' );/sum_stu();print();void delet1() / 刪除數(shù)據(jù)char num110;int i,j,count=0;printf( " 輸入想要刪除的火車列次 "); scanf( "%s" ,num1);for (i=1;i<=t;i+)if (strcmp(num1,hci.hnum)=0)for (j=i;j<t+1;j+

68、) hcj=hcj+1; count+;t-;if (count=0) printf("沒有列車信息! ");else print();void print2()int i;printf( "tt 航次 始站 終站 開機 到場 歷時 n" ););printf( "ttn"for (i=0;i<58;i+)printf( "tt %s%s %s %s %s %sn" ,pli.pnum,pli.kname,pli.dname,pli.ktime,pli.dtime,pli.l time);for (i=58;

69、i<=(58+t);i+)printf( "tt %s %s %s %s %s %sn" ,pli.pnum,pli.kname,pli.dname,pli.ktime,pli.dtime,pli.l time);printf( "ttnn");void creat_data2() / 新建數(shù)據(jù)int i;printf( "請輸入添加飛機個數(shù) : " ); scanf( "%d",&t);for (i=1;i<=t;i+)printf(" 請輸入添加飛機列次 : ");sca

70、nf("%s" ,pli.pnum); printf("n"printf("n 請輸入始站 :" );scanf("%s",pli.kname); printf("n"printf(" 請輸入終站 :" );scanf("%s",pli.dname); printf("n"printf(" 請輸入開車時間 :" );scanf("%s",pli.ktime); printf("n&quo

71、t;printf(" 請輸入到站時間 :" );scanf("%s",pli.dtime); printf("n"printf(" 請輸入經(jīng)歷時間 :" );scanf("%s",pli.ltime); printf("n"/sum_stu(); print();void add2() / 添加數(shù)據(jù) char ch; doprintf( "請輸入添加飛機列次 : " );scanf( "%s",plt+1.pnum); printf(

72、"n" );printf("n 請輸入始站 :" );scanf("%s" ,plt+1.kname); printf("n"printf(" 請輸入終站 :" );scanf("%s" ,plt+1.dname); printf("n"printf( " 請輸入開車時間 :" );scanf("%s",plt+1.ktime); printf("n"printf(" 請輸入到站時間 :

73、" );scanf("%s",plt+1.dtime); printf("n"printf(" 請輸入經(jīng)歷時間 :" );scanf("%s",plt+1.ltime); printf("n"t+;printf(" 是否繼續(xù)添加 y/n:" );getchar();ch=getchar();printf( "n" ); while (ch= 'y' );/sum_stu();print();void delet2() / 刪除數(shù)據(jù)char num210;int i,j,count=0;printf( " 輸入想要刪除的飛機列次 "); scanf( "%s" ,num2);for (i=1;i<=t;i+)if (strcmp(num

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論