#include <iostream> #include <bits/stdc++.h> #include <string> using namespace std; class QueueWithStacks { private: stack<int> st1; // 输入栈 stack<int> st2; // 输出栈 // 辅助函数:当输出栈为空时,将输入栈数据转移过来 void move_st1_to_st2() { while (!st1.empty()) { ...