0_0_19418236_2132.cpp:5:12: error: 'MAXN' was not declared in this scope
int edges[MAXN][MAXN];
^
0_0_19418236_2132.cpp:5:18: error: 'MAXN' was not declared in this scope
int edges[MAXN][MAXN];
^
0_0_19418236_2132.cpp: In function 'void Prim(MGraph, int, int&)':
0_0_19418236_2132.cpp:14:6: error: declaration of 'int sum' shadows a parameter
int sum=0;
^
0_0_19418236_2132.cpp:15:12: error: 'MAXN' was not declared in this scope
int visit[MAXN];//记录顶点是否被访问过
^
0_0_19418236_2132.cpp:19:3: error: 'lowcost' was not declared in this scope
lowcost[i]=g.edges[v][i];
^
0_0_19418236_2132.cpp:19:16: error: 'struct MGraph' has no member named 'edges'
lowcost[i]=g.edges[v][i];
^
0_0_19418236_2132.cpp:20:3: error: 'visit' was not declared in this scope
visit[i]=0;
^
0_0_19418236_2132.cpp:24:3: error: 'min' was not declared in this scope
min=INF; //INF为远大于各个边权值的数
^
0_0_19418236_2132.cpp:24:7: error: 'INF' was not declared in this scope
min=INF; //INF为远大于各个边权值的数
^
0_0_19418236_2132.cpp:27:8: error: 'visit' was not declared in this scope
if(!visit[j] && min>lowcost[j])//选取权值最小的边
^
0_0_19418236_2132.cpp:27:24: error: 'lowcost' was not declared in this scope
if(!visit[j] && min>lowcost[j])//选取权值最小的边
^
0_0_19418236_2132.cpp:33:3: error: 'visit' was not declared in this scope
visit[k]=1;
^
0_0_19418236_2132.cpp:37:20: error: 'lowcost' was not declared in this scope
if(!visit[j] && lowcost[j]>g.edges[k][j])
^
0_0_19418236_2132.cpp:37:33: error: 'struct MGraph' has no member named 'edges'
if(!visit[j] && lowcost[j]>g.edges[k][j])
^
0_0_19418236_2132.cpp:39:18: error: 'struct MGraph' has no member named 'edges'
lowcost[j]=g.edges[k][j]
^
0_0_19418236_2132.cpp: At global scope:
0_0_19418236_2132.cpp:49:1: error: 'typdef' does not name a type
typdef struct
^
0_0_19418236_2132.cpp:53:2: error: 'Road' does not name a type
}Road;
^
0_0_19418236_2132.cpp:55:1: error: 'Road' does not name a type
Road road[maxSize];
^
0_0_19418236_2132.cpp:56:9: error: 'maxSize' was not declared in this scope
int pre[maxSize];
^
0_0_19418236_2132.cpp: In function 'int getRoot(int)':
0_0_19418236_2132.cpp:60:8: error: 'pre' was not declared in this scope
if(x==pre[x])
^
0_0_19418236_2132.cpp:62:9: error: 'pre' was not declared in this scope
return pre[x]=getRoot(pre[x]);
^
0_0_19418236_2132.cpp: At global scope:
0_0_19418236_2132.cpp:65:34: error: 'Road' has not been declared
void Kruskal(MGraph g, int &sum, Road road[])
^
0_0_19418236_2132.cpp: In function 'void Kruskal(MGraph, int&, int*)':
0_0_19418236_2132.cpp:67:6: error: declaration of 'int sum' shadows a parameter
int sum=0;
^
0_0_19418236_2132.cpp:72:3: error: 'pre' was not declared in this scope
pre[i]=i;
^
0_0_19418236_2132.cpp:74:13: error: 'sort' was not declared in this scope
sort(road,e);//e条边升序
^
0_0_19418236_2132.cpp:77:26: error: request for member 'x' in '*(road + ((sizetype)(((long long unsigned int)i) * 4ull)))', which is of non-class type 'int'
int fx=getRoot(road[i].x);
^
0_0_19418236_2132.cpp:78:26: error: request for member 'y' in '*(road + ((sizetype)(((long long unsigned int)i) * 4ull)))', which is of non-class type 'int'
int fy=getRoot(road[i].y);
^
0_0_19418236_2132.cpp:81:4: error: 'pre' was not declared in this scope
pre[fx]=fy;//fx的父节点是fy
^
0_0_19418236_2132.cpp:82:17: error: request for member 'val' in '*(road + ((sizetype)(((long long unsigned int)i) * 4ull)))', which is of non-class type 'int'
sum+=road[i].val;
^
0_0_19418236_2132.cpp: At global scope:
0_0_19418236_2132.cpp:100:12: error: 'MAXN' was not declared in this scope
int edges[MAXN][MAXN];
^
0_0_19418236_2132.cpp:100:18: error: 'MAXN' was not declared in this scope
int edges[MAXN][MAXN];
^
0_0_19418236_2132.cpp:101:2: error: conflicting declaration 'typedef struct MGraph MGraph'
}MGraph;
^
0_0_19418236_2132.cpp:8:2: note: previous declaration as 'typedef struct MGraph MGraph'
}MGraph;
^
0_0_19418236_2132.cpp: In function 'void Dijkstra(MGraph, int, int*)':
0_0_19418236_2132.cpp:104:12: error: 'MAXN' was not declared in this scope
int visit[MAXN];//记录顶点是否被访问过
^
0_0_19418236_2132.cpp:108:13: error: 'struct MGraph' has no member named 'edges'
dist[i]=g.edges[u][i];
^
0_0_19418236_2132.cpp:109:3: error: 'visit' was not declared in this scope
visit[i]=0;
^
0_0_19418236_2132.cpp:111:2: error: 'visit' was not declared in this scope
visit[u]=1;
^
0_0_19418236_2132.cpp:114:7: error: 'INF' was not declared in this scope
min=INF;//INF为远大于所有边权值的值,如 0xffff
^
0_0_19418236_2132.cpp:126:38: error: 'struct MGraph' has no member named 'edges'
if(!visit[j] && dist[j]>dist[k]+g.edges[k][j])
^
0_0_19418236_2132.cpp:128:23: error: 'struct MGraph' has no member named 'edges'
dist[j]=dist[k]+g.edges[k][j];//dist[]数组存放源点U到其余各顶点的最短路径;
^
0_0_19418236_2132.cpp: At global scope:
0_0_19418236_2132.cpp:137:34: error: declaration of 'edges' as multidimensional array must have bounds for all dimensions except the first
void Floyd(MGraph g, int edges[][])
^
0_0_19418236_2132.cpp: In function 'void Floyd(...)':
0_0_19418236_2132.cpp:139:7: error: 'init' was not declared in this scope
init()//初始化edges边表
^
0_0_19418236_2132.cpp:141:6: error: 'k' was not declared in this scope
for(k=1;k<=g.n;k++)
^
0_0_19418236_2132.cpp:141:13: error: 'g' was not declared in this scope
for(k=1;k<=g.n;k++)
^
0_0_19418236_2132.cpp:143:7: error: 'i' was not declared in this scope
for(i=1;i<=g.n;i++)
^
0_0_19418236_2132.cpp:145:8: error: 'j' was not declared in this scope
for(j=1;j<=g.n;j++)
^
0_0_19418236_2132.cpp:147:8: error: 'edges' was not declared in this scope
if(edges[i][j]>edges[i][k]+edges[k][j])
^
0_0_19418236_2132.cpp: At global scope:
0_0_19418236_2132.cpp:160:2: error: 'VNode' does not name a type
VNode adjlist[maxSize];//邻接表
^
0_0_19418236_2132.cpp:165:2: error: 'ArcNode' does not name a type
ArcNode *firstarc;//指向第一条边
^
0_0_19418236_2132.cpp:179:13: error: 'AGrarph' was not declared in this scope
int TopSort(AGrarph *G)
^
0_0_19418236_2132.cpp:179:22: error: 'G' was not declared in this scope
int TopSort(AGrarph *G)
^
0_0_19418236_2132.cpp:180:1: error: expected ',' or ';' before '{' token
{
^
|