这个程序代码怎么不能执行呀?请高手给指点一二
#include<stdio.h>int i=0;
void movedisk(int n,char A,char B,char C);
int main()
{
int n;
printf("Please enter the number of locative:");
scanf("%d",&n);
printf("\thanoi:\tA\tB\tC");
movedisk(n,'A','B','C');
printf("\tTotal:\t%d\n",i);
return 0;
}
void movedisk(int n,char A,char B,char C)
{
movedisk(n-1,A,C,B);
i++;
switch(A)
{
case 'A':
switch(C)
{
case'B':printf("\t[%d]:\t%2d----->%2d\n",i,n,n);break;
case'C':printf("\t[%d]:\t%2d------------>%2d\n",i,n,n);break;
}
case 'B':
switch(C)
{
case'A':printf("\t[%d]:\t%2d<-----%2d\n",i,n,n);break;
case'C':printf("\t[%d]:\t\t%2d----->%2d\n",i,n,n);break;
}
case 'C':
switch(C)
{
case'A':printf("\t[%d]:\t%2d<------------%2d\n",i,n,n);break;
case'B':printf("\t[%d]:\t%2d<-----%2d\n",i,n,n);break;
}
}
movedisk(n-1,B,A,C);
}