提交时间:2023-12-30 08:23:41
运行 ID: 118359
#include<bits/stdc++.h> using namespace std; stack<int>q; int main() { char s; while(cin>>s!=) { if(s!='#'&&s!='@') { q.push(s); } else if(s=='#') { q.pop(); } else { while(!q.empty()) { q.pop(); } } } while(!q.empty()) { cout<<q.top(); q.pop(); } return 0; }