在这里插入代码片
```#include<stdio.h>
#include<stdlib.h>
#define inf 32767
#define max 50
typedef struct ANode
{
int adjvex; //邻接点
struct ANode *next; //指针域
int weight; //权值
}ArcNode; //建立链表,存放边界点
typedef struct Vnode
{
int of; //建立头节点的信息
ArcNode *firstArc;
}VNode; //头节点
typedef struct
{
VNode adjlist[max]; //头节点数组
int n; //顶点个数
}AdjGraph; //图
typedef struct
{
int A[max][max];
int n;
}Agraph; //建立矩阵
void createAdj(Agraph *&A) //输入矩阵关系
{
A=(Agraph *)malloc(sizeof(Agraph));
int n;
scanf("%d",&n);
A->n=n;
for(int i=0;i<n;i++)
{
for(int j=0;j<n;j++)
{
scanf("%d",&A->A[i][j]);
}
}
}
void createAdj(AdjGraph *&G,Agraph *&A)
{
int n=A->n;
ArcNode *p;
G=(AdjGraph *)malloc(sizeof(AdjGraph));
for(int i=0;i<n;i