#include<iostream.h> 
 int main()                                                  
{
 void hanoi(int m,int n1,int n2,int n3); 
 int m;
 cout<<"ÇëÊäÈëÖù×ÓÊýn£º"<<endl;
 cin>>m;
 hanoi(m,1,2,3);
 return(0);
}
 void hanoi(int m,int n1,int n2,int n3) 
{
 if(m==1)
  cout<<n1<<"->"<<n3<<endl;
 else
 {
  hanoi(m-1,n1,n3,n2);
  cout<<n1<<"->"<<n3<<endl;
  hanoi(m-1,n2,n1,n3);
 }
}
