Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
141634 | 秦炜杰 | 行编辑程序 | C++ | 解答错误 | 92 | 0 MS | 252 KB | 427 | 2024-04-06 09:14:47 |
#include<bits/stdc++.h> using namespace std; int main(){ string s; stack<char> st,stt; 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; } //Whil#lr#e(s#*s)