#include<stdio.h>
int main()
{
int hanoi(int n,int disk,char x,char z);
int m;
printf("input the number of diskes:");
scanf("%d",&m);
printf("the step to moveing %d diskes:\n",m);
if(m==1)printf("A-->C");else hanoi(m,1,'A','C');
return 0;
}
int hanoi(int n,int disk,char x,char z)
{
if(n-1==1)printf("No.%dis %c-->%c\n",disk+1,x,198-x-z);else hanoi(n-1,disk+1,x,198-x-z);
printf("No.%dis %c-->%c\n",disk,x,z);
if(n-1==1)printf("No.%dis %c-->%c\n",disk+1,198-x-z,z);else hanoi(n-1,disk+1,198-x-z,z);
return 0;
}