Today is sunday, i want change a job , because my current job is too tird for me, i need stand six hour everday .
函数的递归
汉诺塔:
void move(char A,char C)
{
printf("%c->%c ", A, C);
}
void ht(int n, char A, char B, char C)
{
if (1 == n)
{
move(A, C);
}
else
{
ht(n - 1, A, C, B);
move(A, C);
ht(n - 1, B, A, C);
}
}
int main()
{
int n = 0;
scanf("%d", &n);
ht(n, 'A', 'B', 'C');
return 0;
}