为了输出美观,此处定义MaxInt为9.
#include#define MaxInt 9#define MVNum 100#define MAX_SIZE 100/**邻接矩阵实现无向网*/typedef char VerTexType;typedef int ArcType;using namespace std;typedef struct { VerTexType vexs[10]; ArcType arcs[10][10]; int vexnum; //point int arcnum; //}AMGraph;int init(AMGraph &G){ for(int i=0;i >G.vexnum>>G.arcnum; for(int i=0;i >G.vexs[i]; } for(int i=0;i >v1>>v2>>w; for(int j=0;j