Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
118339 | 林泽豪 | 行编辑程序 | C++ | 通过 | 100 | 0 MS | 264 KB | 282 | 2023-12-30 08:08:16 |
#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]; } }