#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#define TRUE 1
#define FALSE 0
#define OK 1
#define ERROR 0
#define INFEASIBLE -1
#define OVERFLOW -2
#define INFINITY 65535
#define MAX_VERTEX_NUM 20
typedef int Status;
typedef int VRType;
typedef char InfoType;
typedef int VertexType;
typedef enum {DG,DN,UDG,UDN}GraphKind;
typedef struct ArcCell
{
VRType adj;
InfoType *info;
}ArcCell, AdjMatrix[MAX_VERTEX_NUM][MAX_VERTEX_NUM];
typedef struct
{
VertexType vexs[MAX_VERTEX_NUM];
AdjMatrix arcs;
int vexnum,arcnum;
GraphKind kind;
}MGraph;
Status CreateGraph (MGraph *G);
Status CreateDG(MGraph *G);
Status CreateDN(MGraph *G);
Status CreateUDG(MGraph *G);
Status CreateUDN(MGraph *G);
int LocateVex(MGraph G,VertexType v);
Status PrintfArcs(MGraph G);
Status CreateGraph (MGraph *G)
{
printf("请输入图的类型:\n");
printf("0:有向图 1:有向网 2:无向图 3:无向网\n");
scanf("%d",&(*G).kind);
switch((*G).kind)
{
case DG: return CreateDG(G);