Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
141611 | 刘嘉柚 | 行编辑程序 | C++ | 通过 | 100 | 0 MS | 256 KB | 409 | 2024-04-06 09:00:53 |
#include<iostream> #include<cstdio> using namespace std; const int N=1e5+005; int siz; char s[N]; bool empty(){ return siz==0; } void push(char ch){ s[siz++]=ch; } void poper(){ if(!empty()) siz--; } void popest(){ siz=0; } int main(){ char c; while(cin>>c){ if(c=='#') poper(); else if(c=='@') popest(); else push(c); } for(int i=0;i<siz;i++) cout<<s[i]; return 0; }