有关C++调试的问题
我在调试C++时,它总说:C:\fz117\fz117.cpp(493):fatal error c1004:
unexpected end of file found error executing c1.exe.
整个代码才492,493行没内容呀!
代码在下面,请看看
谢谢(我还没输完):
// fz117a.cpp : Defines the entry point for the console application.
中间省了
void main()
{
Toolpackage tool1;
int a[40],b[40];
int *x,*y,*z;
int m,temp,p;
float bestanswer,answer1,answer2;
bestanswer=1000000000;
for(short d=0;d<O;d++)
{
for(short i=0;i<N;i++)a[i]=tool1.rand4(7);
for(short i=0;i<N;i++)b[i]=toll1.rand4(7);
x=a;
y=b;
answer1=tool1.caculatecost(x);
answer2=tool1.caculatecost(y);
if(answer1==-1.0||answer2==-1.0)
{
while(answer1==-1.0)
{
for(short i=0;i<N;i++)a[i]=tool1.rand4(7);
x=a;
answer1=tool1.caculatecost(x);
}
while(answer2==-1.0)
{
for(short i=0;i<N;i++)b[i]=tool1.rand4(7);
y=b;
answer2=tool1.caculatecost(y);
}
}
for(short i=0;i<M;i++)
{
for(short j=0;j<3;j++)
{
m=tool1.rand4(40);
temp=a[m];
a[m]=b[m];
b[m]=temp;
}
x=a;
y=b;
answer1=tool1.caculatecost(x);
while(answer1==-1.0)
{
for(short i=0;i<N;i++)a[i]=tool1.rand4(7);
x=a;
answer1=tool1.caculatecost(x);
}
if(answer1<bestanswer)
{
bestanswer=answer1;
z=a;
}
answer2=tool1.caculatecost(y);
while(answer2==-1.0)
{
for(short i=0;i<N;i++)b[i]=tool1.rand4(7);
y=b;
answer2=tool1.caculatecost(y);
}
if(answer2<bestanswer)
{
bestanswer=answer2;
z=b;
}
}
}
for(short i=1;i<N+1;i++)
{
cout<<i<<"\t"<<*(z+i-1)<<endl;
}
}