void hano(char from,int n,char to,char emp){ if(n > 0){ hano(from,n-1,emp,to); printf("%d from %c to %c\n",n,from,to); hano(emp,n-1,to,from); } }
void hano(char from,int n,char to,char spare) { if(n>0) { hano(from,n-1,spare,to); printf("move %d %c==>%c \n", n , from, to); hano(spare,n-1,from,to); } }
int main(){ hano('a',10,'b','c'); return 0; }
int main() { hano('a',3,'c','b'); //pin(12345); return 0; }