Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
118363 | 唐钧 | 行编辑程序 | C++ | 内存超限 | 0 | 1000 MS | 131092 KB | 350 | 2023-12-30 08:25:23 |
#include<bits/stdc++.h> using namespace std; stack<int>q; int main() { char s; while(scanf("%s",s)!=EOF) { if(s!='#'&&s!='@') { q.push(s); } else if(s=='#') { q.pop(); } else { while(!q.empty()) { q.pop(); } } } while(!q.empty()) { cout<<q.top(); q.pop(); } return 0; }