// 全国交通咨询模拟.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #include #include #include #includeusing namespace std;#define INF 9999999//定义一个最大数定为无穷值#define MAX 30//最多可以添加 15 个城市int addcityflag=0;//标记添加城市的个数int delcityflag=0;//标记删除城市的个数int delcity[6];//delcity[0]不用static int c_number=25;//当前城市个数typedef int costAdj[MAX+1][MAX+1];//邻接矩阵从 1 开始记数//定义该类型int Path[MAX+1][MAX+1][MAX+1];//三维矩阵用来输出 Path[i][i]“二维”中的路径costAdj h_cost,h_time,h_transer,p_cost,p_time,p_transer;//全局矩阵costAdj COST,ELSE;//乘放不同类型的领接矩阵string addcity[6];//addcity[0]不用,最多添加 5 个城市信息//用来添加城市名称void set_h_cost(){//构造火车费用的邻接矩阵for(int i=1;i<=MAX;i++){//矩阵各值置为 INFfor(int j=1;j<=MAX;j++){h_cost[i][j]=INF;}}h_cost[1][2]=h_cost[2][1]=842;//成都-西安h_cost[1][6]=h_cost[6][1]=967;//成都-贵阳h_cost[2][3]=h_cost[3][2]=511;//西安-郑州h_cost[3][10]=h_cost[10][3]=349;//郑州-徐州h_cost[3][4]=h_cost[4][3]=534;//郑州-武汉h_cost[4][5]=h_cost[5][4]=409;//武汉-株洲h_cost[5][8]=h_cost[8][5]=675;//株洲-广州h_cost[5][6]=h_cost[6][5]=902;//株洲-贵阳h_cost[6][7]=h_cost[7][6]=607;//贵阳-柳州h_cost[5][7]=h_cost[7][5]=672;//株洲-柳州h_cost[9][7]=h_cost[7][9]=255;//柳州-南宁h_cost[6][11]=h_cost[11][6]=639;h_cost[1][11]=h_cost[11][1]=1100;h_cost[5][13]=h_cost[13][5]=367;h_cost[8][12]=h_cost[12][8]=140;h_cost[13][14]=h_cost[14][13]=622;h_cost[13][15]=h_cost[15][13]=825;h_cost[10][15]=h_cost[15][10]=651;h_cost[10][17]=h_cost[17][10]=674;h_cost[3][16]=h_cost[16][3]=695;h_cost[16][17]=h_cost[17][16]=137;h_cost[17][18]=h_cost[18][17]=704;h_cost[18][19]=h_cost[19][18]=397;h_cost[18][20]=h_cost[20][18]=305;h_cost[20][21]=h_cost[21][10]=242;h_cost[16][23]=h_cost[23][16]=668;h_cost[2][22]=h_cost[22][2]=676;h_cost[22][23]=h_cost[23][22]=1145;h_cost[22][25]=h_cost[25][22]=216;h_cost[22][24]=h_cost[24][22]=1892;}voi...