Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
141687 | 秦炜杰 | 行编辑程序 | C++ | 解答错误 | 92 | 0 MS | 256 KB | 416 | 2024-04-06 09:59:16 |
#include<bits/stdc++.h> using namespace std; int main(){ string s; stack<char> st,stt; getline(cin,s); for(int i=0;i<s.size();i++){ if(s[i]=='#'&&st.size()) st.pop(); else if(s[i]=='@'&&st.size()){ while(!st.empty()) st.pop(); } else st.push(s[i]); } while(!st.empty()){ stt.push(st.top()); st.pop(); } while(!stt.empty()){ cout<<stt.top(); stt.pop(); } return 0; }