#include<stdio.h>
void hanoi(int n,char a,char b,char c)
{//把n个盘子从a柱移动到c柱
if(n>0)
{
hanoi(n-1,a,c,b);//n-1个盘子从a移动到b
printf("%c->%c\n",a,c);//1个盘子从a移动到c
hanoi(n-1,b,a,c);//n-1个盘子从b移动到c
}
}
int main()
{
char a='A',b='B',c='C';
int n;
hanoi(n,'A','B','C');
return 0;
}