提交时间:2024-04-06 10:58:12
运行 ID: 141773
#include<bits/stdc++.h> using namespace std; char s[114514]; int tot=0; bool empty(){ return tot==0; } void push(char ch){ s[tot++]=ch; } void pop1(){ if(!empty()) tot--; } void pop2(){ tot=0; } int main(){ char c; while(cin>>c){ if(c=='#') pop1(); else if(c=='@') pop2(); else push(c); } for(int i=0;i<tot;i++) cout<<s[i]; return 0; }