题解四解
2026-09-22 21:37:04
发布于:浙江
8阅读
0回复
0点赞
四解!!
#include<bits/stdc++.h>
using namespace std;
int main(){
stack<char>st;
char ch;
while(cin>>ch){
if(ch=='@'){
if(st.empty()==0){
st.pop();
}
}
else{
st.push(ch);
}
}
stack<char>st1;
while(!st.empty()){
st1.push(st.top());
st.pop();
}
while(!st1.empty()){
cout<<st1.top();
st1.pop();
}
return 0;
}
全部评论 2
[作者]感谢有意义的人发表
2026-09-22 来自 浙江
0[作者]求给个点赞
2026-09-22 来自 浙江
0

有帮助,赞一个