《算法很美》——汉诺塔游戏(递归)
package test_1;
public class Test_05 {
//递归
public static void main(String[] args) {
hanoiTower(3, "A", "B", "C");
}
static void hanoiTower(int N, String from, String to, String help) {
if (N == 1) {
System.out.println(" move " + N + " from " +
原创
2021-04-06 09:10:38 ·
132 阅读 ·
1 评论