stack<int> s;
stack<int> tmp_s;
/** Initialize your data structure here. */
MyQueue() {
}
/** Push element x to the back of queue. */
void push(int x) {
int size = s.size();
for(int i = 0;i < size;i++)
{
int tmp = s.top();
tmp_s.push(tmp);
s.pop();
}
tmp_s.push(x);
size = tmp_s.size();
for(int i = 0;i < size;i++)
{
int tmp = tmp_s.top();
s.push(tmp);
tmp_s.pop();
}
}
/** Removes the element from in front of queue and returns that element. */
int pop() {
int tmp = s.top();
s.pop();
return tmp;
}
/** Get the front element. */
int peek() {
return s.top();
}
/** Returns whether the queue is empty. */
bool empty() {
if(s.size() == 0)
return true;
return false;
}