无敌鸡心
2024-02-19 16:00:47
发布于:北京
#include<bits/stdc++.h>
using namespace std;
string a[1005];
int id;
int n;
int head,tail;
void push(string x){
a[tail++]=x;
}
void pop(){
if(head<tail) head++;
}
bool empty(){
return head ==tail;
}
int size(){
return tail-head;
}
string front(){
return a[head];
}
string back(){
return a[tail-1];
}
int main(){
int tmp;
string s;
while(true){
cin>>s;
if(s=="end") {
if(!empty()){
for(int i=head;i<tail;i++){
cout<<a[i];
}
cout<<endl;
}
return 0;
}
if(s[0]=='1'){
push(s);
}
else if(s=="out"){
cin>>tmp;
if(empty()) printf("empty");
else{
for(int i=head;i<tmp;i++){
cout<<front()<<" ";
pop();
}
}
cout<<endl;
}
}
}
全部评论 8
流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪
2024-02-19 来自 北京
0jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
2024-02-19 来自 北京
0流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪流泪
2024-02-19 来自 北京
0差
2024-02-19 来自 北京
0#include<bits/stdc++.h>
using namespace std;
int x,head,tail,n;
非vip只能看到10%,请开通vip2024-02-19 来自 北京
0筷子水泥直接
2024-02-19 来自 北京
0lj
2024-02-19 来自 北京
0无敌鸡心
2024-02-19 来自 北京
0
有帮助,赞一个