哪位高手帮我一下
int i=0;void main()
{
int m;
cin>>m;
cout<<"buzhou:";
cout<<endl;
hanoi(m,'A','B','C');
out();
}
void hanoi(int n,char one, char two, char three)
{
if(n==1)
move(one,three);
else
{
hanoi(n-1,one,three,two);
move(one,three);
hanoi(n-1,two,one,three);
}
}
void move( char x, char y )
{
cout<<"从"<< x<<"到"<<y ;
i++;
cout<<endl;
}
void out()
{
cout<<"总共要搬"<<i<<"次";
cout<<endl;
}
哪位高手帮我一下
谢谢了
其中的void hanoi(int n,char one, char two, char three) ;函数到底是怎样运行的啊
要详细的解答