1 #include2 #include 3 using namespace std; 4 stack S[3]; 5 int ans; 6 void move(int x,int y){ 7 int temp=S[x].top(); 8 S[x].pop(); 9 S[y].push(temp);10 cout< <<" --> "< < >n;25 for(int i=n;i>=1;i--){26 S[0].push(i);27 }28 hanoi(0,1,2,n);29 while(!S[2].empty()){30 S[2].pop();31 }32 cout<<"¹²"< <<"´Î";33 return 0;34 }