提交时间:2024-04-06 09:29:39
运行 ID: 141655
#include <bits/stdc++.h> using namespace std; stack <char> n; stack <char> tmp; void clean(){ while(!n.size()) n.pop(); } int main(){ char t; while(~getchar(t)){ 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(); }