~cpp #include<stdio.h> int cnt = 0; void movehanoi(char a, char b, char c, int n); void movehanoi(char from, char temp, char to, int n) { if(n==1){ ++cnt; printf("%5d: %c %c %d \n", cnt, from, to, 1); } else{ movehanoi(from, to, temp, n-1); ++cnt; printf("%5d: %c %c %d \n", cnt, from, to, n); movehanoi(temp, from, to, n-1); } } // int main(void) { int n; printf(" 기 ?>"); scanf("%d", &n); movehanoi('A', 'B', 'C', n); return 0; } //