提交时间:2023-12-30 08:25:23
运行 ID: 118363
#include<bits/stdc++.h> using namespace std; stack<int>q; int main() { char s; while(scanf("%s",s)!=EOF) { 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; }