..^^
~cpp #include <iostream> int answer=0; void hanoi(int, int, int, int); using namespace std; void main() { int number; cout << " 개 >>"; cin >> number; hanoi (1,3,2,number); cout << " "<< answer << "."; } void hanoi(int from, int middle, int target, int num) { ++answer; if (1==num) { cout << from << "" << target << " 깁.\n"; } else { hanoi (from, target, middle, num-1 ); cout << from << "" << target << " 깁.\n"; hanoi (middle, from, target, num-1 ); } }