愚公移山 完美版:error C2601: 'main' : local function definitions are illegal如何解决啊?

来源:百度文库 编辑:高校问答 时间:2024/05/10 08:33:27
原代码如下: (这是一个FLOYD算法的验证程序。)
#include<iostream.h>
#include<stdlib.h>
typedef char VerT;
const int MaxVertices=20;
const int MaxWeight=10000;
typedef char DataType;
#include"AdjMWGraph.h"
#include"CreatAdjMWGraph.h"
#include"Floyd.h"
void main(void)
{
AdjMWGraph g;
char a[]={'A','B','C'};
RowColWeight rcw[]={{0,2,5},{2,1,6},{1,0,4},{0,1,12}};
int n=3,e=4;
GreatGraph(g,a,n,rcw,e);
Floyd(g);
}
出错如下:C:\C++\code\第8章\弗洛伊德算法\practice.cpp(11) : error C2601: 'main' : local function definitions are illegal
C:\C++\code\第8章\弗洛伊德算法\practice.cpp(19) : fatal error C1004: unexpected end of file found
请各位高手 给个建议啊! 谢谢!

所包的头文件里的问题,你再把自己写的头文件仔细检查检查。