提交时间:2024-04-06 10:20:35
运行 ID: 141722
#include<bits/stdc++.h> using namespace std; int head,tail; char a[10010]; string d; int main() { getline(cin,d); for(int i=0;i<d.size();i++) { if(d[i]=='#') { tail--; } else if(d[i]=='@') { head=tail=tail+1; } else { a[++tail]=d[i]; } } for(int i=head;i<=tail;i++) { cout<<a[i]; } return 0; }