编写有关汉诺塔程序的问题
哪位高手能解释一下以下意思(汉诺塔程序思路是怎么样的?):
void move(char getone,char putone)
{ printf("%c-->%c\n",getone,putone);
}
void hanoi(int n,char one ,char two ,char three)
{ if(n==1)move(one,three);
else
{hanoi(n-1,one,three,two);
move(one,three);
hanoi(n-1,two,one,three);
}
}
main()
{ hanoi(3,'A','B','C');
}