提交时间:2023-12-30 08:08:16
运行 ID: 118339
#include<bits/stdc++.h> using namespace std; int main(){ char a[100000],b[100000]; gets(a); int p=0; for(int i=0;i<strlen(a);i++){ if(a[i]=='#'){ p=max(p-1,0); }else{ if(a[i]=='@')p=0; else{ b[p++]=a[i]; } } } for(int i=0;i<p;i++){ cout<<b[i]; } }