Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
119255 吴悠 行编辑程序 C++ 通过 100 0 MS 248 KB 544 2024-01-05 13:25:35

Tests(14/14):


#include<bits/stdc++.h> using namespace std; stack <char> stk; int main(){ string s; getline(cin,s); for (int i = 0;i < s.size();i++){ char x = s[i]; if (x == '#' && !stk.empty()){ stk.pop(); } else if (x == '@'){ while (!stk.empty()){ stk.pop(); } } else if (x != '#' && x != '@'){ stk.push(x); } } deque <char> q; while (!stk.empty()){ //putchar(stk.top()); q.push_back(stk.top()); stk.pop(); } while (!q.empty()){ putchar(q.back()); q.pop_back(); } return 0; }


测评信息: