#include <bits/stdc++.h>
using namespace std;
#define MaxVertexNum 100 /*最大顶点数设为100*/
#define INFINITY 65535 /*无穷大设为双字节无符号整数的最大值*/
typedef int Vertex; /*顶点下标为整型,用来表示顶点*/
typedef int WeightType; /*边的权值设为整型*/
/*边的抽象定义*/
typedef struct ENode{
Vertex V1, V2;
WeightType Weight;
}ENode;
typedef ENode *PtrToENode;
typedef PtrToENode Edge;
/*图的抽象定义*/
typedef struct GNode{
int NumberofVertex;
int NumberofEdge;
WeightType G[MaxVertexNum][MaxVertexNum];
}GNode;
typedef GNode *PtrToGNode;
typedef PtrToGNode MGraph;
MGraph CreateGraph(int VertexNum);
void InsertEdge(MGraph Graph, Edge E);
MGraph BuildGraph();
void Floyd(MGraph Graph, WeightType Dist[][MaxVertexNum]);
void FindAnimal(MGraph Graph);
WeightType FindMaxDist(WeightType Dist[][MaxVertexNum], Vertex i, int N);
int main()
{
#ifdef ONLINE_JUDGE
#else
freopen("in.txt", "r", stdin);
#endif
MGraph G = BuildGraph();
FindAnimal(G);
return 0;
}
/*初始化一个有VertexNum个顶点
中国大学MOOC-陈越、何钦铭-数据结构-2018秋 07-图4 哈利·波特的考试 (25 分)
最新推荐文章于 2023-05-14 21:54:31 发布