hanoi(n-1,A,C,B); printf当前A-C; hanoi(n-1,B,A,C);
void hanoi(int n,char A,char B,char C){ if(n<=1){ printf("1 move %c to %c\n",A,C); return; } hanoi(n-1,A,C,B); printf("%d move %c to %c\n",n,A,C); hanoi(n-1,B,A,C); }