高分问题,大家过来看看这个floyd算法的源代码

2025-05-20 12:52:54
推荐回答(1个)
回答1:

我没有编译过去你的程序
估计是Graph结构有问题吧

struct Graph{
int vexnum;
double arcx[M_vexnum][M_arcnum];
}
错误信息,下面的,我使用linux编译的
你看看你的结构是不是有问题,你编这个东西干嘛,好乱啊,没必要吧?
呵呵,别的我也搞不清楚了
能帮你的只有这么多,我也是个新手
test.c: In function `Short_Path':
test.c:24: `G' undeclared (first use in this function)
test.c:24: (Each undeclared identifier is reported only once
test.c:24: for each function it appears in.)
test.c:47: `cout' undeclared (first use in this function)
test.c:48: `endl' undeclared (first use in this function)
test.c: In function `main':
test.c:57: `Graph' undeclared (first use in this function)
test.c:57: syntax error before "G"
test.c:58: `G' undeclared (first use in this function)
test.c:60: `cout' undeclared (first use in this function)
test.c:61: `cin' undeclared (first use in this function)
test.c:62: `for' loop initial declaration used outside C99 mode
test.c:63: `for' loop initial declaration used outside C99 mode
test.c:56: warning: return type of `main' is not `int'