Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
118428 | 吴悠 | 行编辑程序 | C++ | 编译错误 | 0 | 0 MS | 0 KB | 482 | 2023-12-30 11:13:20 |
#include<bits/stdc++.h> using namespace std; int top=0,ttop=0; char a[114514]; char c; void push(){ a[top++]=c; } void pop(){ top--; } void popl(){ top=0; } bool empty(){ if(top==0){ return true; } else return false; } int main(){ while(cin>>c){ if(c=='#' && empty()==false){ pop(); } else if(c=='@' && empty()==false){ popl(); } else push(c); } while(empty()==false){ cout<<a[ttop++]; top--; } }