【正文】
\n,vertex[j].name)。 while(path[i][u] != 0) { u = path[i][u]。 b = j。 path[i][j] = path[j][i] = u。 i MAX_VERTEX_NUM。 path[i][j] = 0。 i MAX_VERTEX_NUM。 return。number)。 printf(\n\n\n)。 printf( | | | \n)。 printf( | | | \n)。 dist[8][9] = dist[9][8] =120。 dist[4][7] = dist[7][4] = 100。 dist[2][5] = dist[5][2] = 30。 ++i) { dist[i][i] = 0。 j MAX_VERTEX_NUM。 strcpy(vertex[9].introduce,Information institute, college building)。 strcpy(vertex[8].name,No. 1 teaching building)。 /*vertex[7].number = 8。 strcpy(vertex[6].introduce,Area B student dining area)。 strcpy(vertex[5].name,Area A restaurant)。 vertex[4].number = 4。 strcpy(vertex[2].introduce,Area A student rest area)。 strcpy(vertex[1].name,Area C dormitory building)。 } } }while(1)。) { printf(\n\n\n\t\t\t\tThank you for you use\n\n\n)。) { Information()。) { shortestpath()。 } if(c != 39。) { c += 32。 amp。 loop: scanf(%c,amp。 to query information\n)。s39。 init()。 char introduce[100]。選擇“s”,調(diào)用shortestpath函數(shù),并同時(shí)調(diào)用floyd和way函數(shù)。 int number。 數(shù)字:從1到9輸入。課程設(shè)計(jì)報(bào)告書課程名稱 數(shù)據(jù)結(jié)構(gòu) 設(shè)計(jì)題目 校園導(dǎo)航系統(tǒng) 專業(yè)班級(jí) 計(jì)算機(jī)114 班 目錄……………………………………………… 2……………………………………………… 2……………………………………………… 2……………………………………………… 2………………………………………………… 2………………………………………………… 3………………………………………………… 4………………………………………………12…………………………………………………………12…………………………………………………………13 附錄………………………………………………………145 總結(jié)與展望…………………………………………… 20……………………………………………… 21……………………………………………… 211 設(shè)計(jì)時(shí)間 2013年12月3日2 設(shè)計(jì)目的1.加深對(duì)《數(shù)據(jù)結(jié)構(gòu)》這一課程所學(xué)內(nèi)容的進(jìn)一步理解與鞏固2.通過完成課程設(shè)計(jì),逐漸培養(yǎng)自己的編程能力;3.培養(yǎng)給出題目后,構(gòu)建框架,用計(jì)算機(jī)解決的能力;4.通過調(diào)試程序積累調(diào)試C程序設(shè)計(jì)的經(jīng)驗(yàn); 3設(shè)計(jì)任務(wù)給出校園各主要建筑的名稱信息及有線路聯(lián)通的建筑之間的距離,利用校園導(dǎo)航系統(tǒng)計(jì)算出給定的起點(diǎn)到終點(diǎn)之間的最近距離及線路。(3) floyd() 弗洛伊德求最短路徑(4) information()——輸出簡(jiǎn)介的函數(shù)(5) Path()——最短路徑的輸出函數(shù)(6) shortestpath()——調(diào)用弗洛伊德和最短路徑輸出的函數(shù)(7) main()——主函數(shù)2.輸入的形式和輸入值的范圍:輸入數(shù)字和字母: 字母:以s查詢最短路徑;以i查詢信息;以e退出程序。 The shortest distance is:150meters.Input:i Output:Please enter the number of query site: 3Output:name: Area B dormitory building introduction:Area B student rest areainput:e output:Thank you for you use 1.抽象數(shù)據(jù)類型定義typedef struct{ char name[100] 。2.主程序模塊的整體流程 進(jìn)入主函數(shù),調(diào)用init(),map()。 int number。 printf( Wele to use the shandong university of science and technology of navigation system\n\n\n\n)。 do { printf(Please enter the 39。i39。 to exit the program\n\n\n)。A39。Z39。) { goto loop。s39。i39。e39。 continue。 vertex[1].number = 1。 strcpy(vertex[2].name, Area A dormitory building)。 strcpy(vertex[3].introduce,Area B student rest area)。 ver