建立有向网络的邻接矩阵算法 void creatmatrix(matrix *gra) /*建立有向网络的邻接矩阵算法*/ {int p,q,x,w; printf("The n and e are:\n"); scanf("%d%d",&gra;->n,&gra;->e); /*输入顶点数和边数*/ getchar(); printf("The vertexs are:\n"); for(p=0;pn;p++) /*输入各个顶点*/ scanf("%c",&gra;->vert[p]) ; for(p=0;pn;p++) /*将邻接矩阵初始化*/ for(q=0;qn;q++) if (p==q) gra->edge[p][q]=0; el se gra->edge[p][q]=MAXSIZE; printf("The edges are:\n"); se gra->edge[p][q]=MAXSIZE; printf("The edges are:\n");