题解
2025-06-18 17:28:41
发布于:江苏
6阅读
0回复
0点赞
#include<iostream>
#include<string>
using namespace std;
char a[110],top=0;
void push(int x){
a[++top]=x;
}
void pop(){
--top;
}
int main(){
string s;
while(getline(cin,s)){
top=0;
for(int i=0;i<=s.size();i++){
if(s[i]=='#'){
pop();
}else if(s[i]=='@'){
top=0;
}else{
push(s[i]);
}
}
for(int i=1;i<top;i++){
cout<<a[i];
}
cout<<'\n';
}
return 0;
}
这里空空如也
有帮助,赞一个