classMyQueue{public:
stack<int> StIn;
stack<int> StOut;MyQueue(){}voidpush(int x){
StIn.push(x);}intpop(){if(StOut.empty()){while(!StIn.empty()){
StOut.push(StIn.top());
StIn.pop();}}int result = StOut.top();
StOut.pop();return result;}intpeek(){int res =this->pop();
StOut.push(res);return res;}boolempty(){return StIn.empty()&& StOut.empty();}};/**
* Your MyQueue object will be instantiated and called as such:
* MyQueue* obj = new MyQueue();
* obj->push(x);
* int param_2 = obj->pop();
* int param_3 = obj->peek();
* bool param_4 = obj->empty();
*/