提交时间:2024-04-06 10:06:54

运行 ID: 141706

#include <bits/stdc++.h> using namespace std; stack <char> n; stack <char> tmp,in; void clean(){ while(!n.size()) n.pop(); } int main(){ char t; while(1){ t=getchar(); if(!t) break; if(t!='#'&&t!='@') n.push(t); if(t=='#') n.pop(); if(t=='@') clean(); } while(!n.size()){ tmp.push(n.top()); n.pop(); } while(!tmp.size()) cout<<tmp.top(),tmp.pop(); }