N阶Hanoi塔问题
要求:(1) 采用分治策略,写出相应问题的递归算法及程序,(2)要求输出整个搬动过程。
/* 递归演示汉诺塔移动过程(设最上面的一个盘子为第1个盘子) */
include<stdio.h>
//Show the movement of the n-th plate
void move(int n, int x, int y){
printf("the %dth plate from %c to %c\n",n,x+65,y+65);
}
//将n个盘子从A座移到C座的过程(借助B座)
void hanoi(int n, int A, int