B服行会:红萌馆 1407326174797
刷
历
编
阅读
2020-09-23更新
最新编辑:Zero波君
阅读:
更新日期:2020-09-23
最新编辑:Zero波君
跳到导航
跳到搜索
public class Hanoi{
private static int step=0; private Hanoi(char x,char y){ step++; System.out.print(x+"->"+y); system.out.print(step%10==0? "\n":"\t"); } public Hanoi(int n,char a,char b,char c){ if(n<=1) new Hanoi(a,c); else{ new Hanoi(n-1,a,c,b); new Hanoi(a,c); new Hanoi(n-1,b,a,c); } }
}