在里面ans很重要
2026-08-07 20:07:00
发布于:广东
5阅读
0回复
0点赞
#include<bits/stdc++.h>
using namespace std;
const int N=1e5+1;
long long n,m;
stack <char>st;
int main(){
string s;cin>>s;
for(int i=0;i<s.size();i++){
if(s[i]!='@') st.push(s[i]);
else{
if(!st.empty())st.pop();
}
}
string ans=" ";
while(!st.empty()){
ans=st.top()+ans;
st.pop();
}
cout<<ans;
return 0;
}
这里空空如也


有帮助,赞一个