HANOI塔问题的头文件

来源:百度知道 编辑:UC知道 时间:2024/05/16 19:20:54
你能把那个头文件写出来的话,问题可能就解决了
要用C语言版的.前面有人做出了程序,但他没给出头文件.我需要那个头文件,否则,程序不能运行

我用Java编写方法
public void hanoi(int n, String one, String two, String three)
{
if(n==1) move(one, three);
else
{
hanoi(n-1, one, three, two);
move (one, two);
hanoi(n-1, two, one, three);
}
}
public void move(String a, String b)
{
System.out.println(a+"→"+b);
}
这段程序主要是方法, 用其它语言也是这种递归方法,可以适当改动