100 60 100 100 100 第一题 int main() { int t; cin >> t; for (int i = 0; i < t; i++) { int n; cin >> n; cin.ignore(20, '\n&(392)#39;); string line; queue<int>temp; for (int j = 0; j < n; j++) { getline(cin, line); if (line.find("PUSH") != -1) { int num = stoi(line.substr(5, line.length())); temp.push(num); } else if (line.find("TOP") != -1) { if (temp.empty()) { cout << -1 << endl; } else { cout << temp.front() << endl; } } else if (line.find("POP") != -1) { if (temp.empty()) { cout << -1 << endl; } else { temp.pop(); } } else if (line.find("SIZE") != -1) { cout << temp.size() << endl; } else if (line.find("CLEAR") != -1) { while (!temp.empty()) { temp.pop(); } } } } return 0; }