/*
* 递归高级应用之汉诺塔totoalNum是盘子总数,from是原始塔,center是中间塔,to是目的地塔。
* */
public static void Tower(int totalNum,char from,char center,char to){
if(totalNum==1){
System.out.println("盘子从"+from+"塔到"+to+"塔");
}else{
Tower(totalNum-1, from, to, center);
System.out.println("盘子从"+from+"塔到"+to+"塔");
Tower(totalNum-1, center, from, to);
}
}