#include <iostream>
using namespace std;
void move(char x,char y)
{
cout<<x<<"---->"<<y<<endl;
}
void hannota(int n,char one,char two,char three)
{
if(n==1)
move(one,three);
else
{
hannota(n-1,one,three,two);
move(one,three);
hannota(n-1,two,one,three);
}
}
int main()
{
int m;
cout<<"请输入盘子数量:";
cin>>m;
cout<<endl<<"步骤是:"<<endl;
hannota(m,'A','B','C');
return 0;
}