一级方程式赛车2009:编程时候出现的错误!!!!

来源:百度文库 编辑:神马品牌网 时间:2024/04/26 15:01:48
int t,k,i;
#include<stdio.h>
#include<math.h>
void main()
{
int comp(int x,int y);
int check(int x[]);
int sum(int x[]);
char image(int x);
void load(int x);
void unload(int x);
void getinb(int x);
void getina(int x);
int north[3],south[3];
i=0,north[0]=2,north[1]=3,north[2]=4,south[0]=0,south[1]=0,south[2]=0;

//操作开始
do{
for(i=0;i<3;i++)//for1 //南岸的操作
{
load(south[i]);
if(check(south))
{//if1
if (t!=k)
{//if2
getinb(t);
break;
}//if2
}//if1
else unload(south[i]);
}//for1

if(!check(north)) //北岸的操作
{//if3
for(i=0;i<3;i++)//for2
{
load(north[i]);
if(check(north))
{//if4
if(t!=k)
{//if5
getina(t);
break;
}//if5
}//if4
else unload(north[i]);
}//for2
}//if3
}while(sum(north)<3);
}//main

//函数定义

int comp(int x,int y)
{
return (fabs(x-y)==1?0:1);
}

int check(int x[])
{
return (comp(x[1],x[2])&&comp(x[2],x[3])&&comp(x[1],x[3]));
}

int sum(int x[])
{
int y=0;
for(i=0;i<3;i++)
{
if(x[i]!=0) y++;
}
return(y);
}

int image(int x)
{
switch(x)
{
case 2:return 'w';
case 3:return 's';
case 4:return 'c';
}
}

void load(int &x)
{
t=x;
x=0;
}

void unload(int &x)
{
x=t;
}

void getinb(int x)
{
if(x=0) printf("south---->north with nothing");
else printf("south------->norht with %s",image(x));
}

void getina(int x)
{
if(x=0) printf("north---->south with nothing");
else printf("north------->souht with %s",image(x));
}

编译没有问题,就是连接的时候出现了

Linking...
15.obj : error LNK2001: unresolved external symbol "void __cdecl unload(int)" (?unload@@YAXH@Z)
15.obj : error LNK2001: unresolved external symbol "void __cdecl load(int)" (?load@@YAXH@Z)
Debug/15.exe : fatal error LNK1120: 2 unresolved externals
执行 link.exe 时出错.

我的电脑重装过,MVC没有重装,会不会与这有关!!