太简单了
2025-03-02 11:22:17
发布于:贵州
1阅读
0回复
0点赞
#include <bits/stdc++.h>
using namespace std;
int n, op, x;
queue<int>q;
int main(){
cin >> n;
while(n -- ){
cin >> op;
if(op == 1){
cin >> x;
q.push(x);
}
if(op == 2){
if(q.empty()) cout << "impossible!" << endl;
else q.pop();
}
if(op == 3){
if(q.empty()) cout << "impossible!" << endl;
else cout << q.front() << endl;
}
}
return 0;
}
这里空空如也
有帮助,赞一个