#include#include #define INT_MAX 10000 #define n 10 int cost[n][n];/* 边的值*/ int shortest[n][n];/* 两点间的最短距离*/ int path[n][n];/* 经过的景点*/ /*自定义函数原型说明*/ void introduce(); int shortestdistance(); void floyed(); void display(int i,int j); 2个人分工 (1)景点信息查询 (2)两景点的最短距离 (3)两个景点之间的路径 三、详细设计 void main() {/*主函数*/ int i,j; char k; for(i=0;i<=n;i++) for(j=0;j<=n;j++) cost[i][j]=INT_MAX; cost[1][3]=cost[3][1]=2; cost[2][3]=cost[3][2]=1; cost[2][4]=cost[4][2]=2; cost[3][10]=cost[10][3]=4; cost[1][10]=cost[10][1]=4; cost[2][10]=cost[10][2]=4; cost[4][10]=cost[10][4]=4; cost[1][4]=cost[4][1]=5; cost[4][5]=cost[5][4]=3; cost[4][9]=cost[9][4]=4; cost[5][9]=cost[9][5]=8; cost[5][7]=cost[7][5]=4; cost[5][6]=cost[6][5]=2; cost[6][7]=cost[7][6]=1; cost[7][8]=cost[8][7]=3; cost[8][6]=cost[6][8]=4; cost[1][1]=cost[2][2]=cost[3][3]=cost[4][4]=cost[5][5]=0;