#include<stdio.h>
long count;
void hanoi(int n,char a,char b,char c)
{
if(1==n)
printf("第%d次,%c柱-->%c柱\n",++count,a,c);
else
{
hanoi(n-1,a,c,b);
printf("第%d次,%c柱-->%c柱\n",++count,a,c);
hanoi(n-1,b,a,c);
}
}
int main()
{
int h;
printf("请输入A柱圆盘的个数:");
scanf("%d",&h);
count=0;
hanoi(h,'A','B','C');
return 0;
}