用栈解决汉诺塔问题

#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
相关文章
相关标签/搜索