package blueBridge;
import java.util.*;
import java.math.BigInteger;
import java.util.*;
public class testOne {
/*
* 题目
* 汉诺塔
* */
static void HanoiTower(int N,String from,String to,String help) { //
if(N==1) {
System.out.println("move"+N+"from"+from+"to"+to);
return;
}else {
HanoiTower(N-1, from, help, to); //分:1-N-1从A移动到C,B为辅助
System.out.println("move"+N+"from"+from+"to"+to);
HanoiTower(N-1, help, to, from); //分:1-N-1从C移动到B,A为辅助
}
}
public static void main(String[] args) {
HanoiTower(3, "A", "B", "C"); //总:1-N从A移动到B,C为辅助
}
}