汉诺塔小程序执行的问题
#include <iostream>using namespace std;
void move(char no1,char no2)
{
cout<<no1<<"移动到"<<no2<<endl;
}
void hannoi(int n,char n1,char n2,char n3)
{
if(n==1)
move (n1,n3);
else
{
hannoi(n-1,n1,n3,n2);
move(n1,n3);
hannoi(n-1,n2,n1,n3);
}
}
int main()
{
void hanoi(int n,char n1,char n2,char n3);
int m;
cout<<"请输入A柱上金盘的总数:";
cin>>m;
cout<<"当有"<<m<<"个金盘时,移动的步骤依次为:"<<endl;
hanoi(m,'A','B','C');
return 0;
}
--------------------------------------------------------------------------------
执行的时候出现了错误
汉诺塔.obj : error LNK2001: unresolved external symbol "void __cdecl hanoi(int,char,char,char)" (?hanoi@@YAXHDDD@Z)
Debug/汉诺塔.exe : fatal error LNK1120: 1 unresolved externals
什么意思啊,要怎么改,帮忙下