`http://www.lintcode.com/zh-cn/problem/implement-queue-by-two-stacks/
class Queue {
public:
stack stack1;
stack stack2;
Queue() {
}
void push(int element) {
stack1.push(element);
}
int pop() {
adjust();
int temp = stack2.top();
stack2.pop();
return temp;
}
void adjust()
{
if (stack2.empty())
{
while(!stack1.empty())
{
stack2.push(stack1.top());
stack1.pop();
}
}
}
int top() {
adjust();
return stack2.top();
}
};
`