用棧解決漢諾塔問題

#include <iostream> #include <stack> using namespace std; stack<int> S[3]; void move (int x, int y) { int temp = S[x].top(); S[x].pop(); S[y].push(temp); cout << x << "-->" << y << end
相關文章
相關標籤/搜索