改了一下午结果x打成y.....
2025-11-30 10:09:11
发布于:浙江
1阅读
0回复
0点赞
#include<bits/stdc++.h>
using namespace std;
queue<int> q;
void spush(int x){
q.push(x);
}
void spop(){
if(q.empty()) cout << "impossible!" << endl;
else{
q.pop();
}
}
void stop(){
if(q.empty()) cout << "impossible!" << endl;
else cout << q.front() << endl;
}
int main(){
int n;
cin >> n;
while(n--){
int x,y;
cin >> x;
if(x==1){
cin >> y;
spush(y);
}else if(x==2){
spop();
}else if(x==3){
stop();
}
}
}
这里空空如也







有帮助,赞一个