1.code
public static void main(String[] args) {
int level = ;
moveDish(, 'A', 'B', 'C'); } public static void moveDish(int level, char from, char inter, char to){
if(level==){
System.out.println("从" + from + "移动" + level + "号盘到" + to );
}else{
moveDish(level-, from, to, inter);
System.out.println("从" + from + "移动" + level + "号盘到" + to );
moveDish(level-, inter, from, to);
}
}
2. 效果图