Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
141607 | 刘嘉柚 | 行编辑程序 | C++ | 解答错误 | 0 | 0 MS | 252 KB | 420 | 2024-04-06 08:53:49 |
#include<iostream> #include<cstdio> using namespace std; int siz; string s; bool empty(){ return siz==0; } void push(char ch){ s[siz++]=ch; } void poper(){ if(!empty()) siz--; } void popest(){ siz=0; } int size(){ return siz; } int main(){ char c; while(cin>>c){ if(c=='#') poper(); else if(c=='@') popest(); else push(c); } for(int i=1;i<=size();i++) cout<<s[i]; return 0; }