Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
141604 刘嘉柚 行编辑程序 C++ 运行出错 0 0 MS 256 KB 462 2024-04-06 08:47:56

Tests(0/14):


#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(){ string c; int i=1; while(cin>>c[i]){ if(c[i]=='#') poper(); else if(c[i]=='@') popest(); else push(c[i]); i++; } for(int i=1;i<=size();i++) cout<<s[i]; return 0; }