Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
141773 | 秦炜杰 | 行编辑程序 | C++ | 通过 | 100 | 0 MS | 252 KB | 383 | 2024-04-06 10:58:12 |
#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; }