| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 141600 | 谢思涵 | 行编辑程序 | C++ | Runtime Error | 64 | 0 MS | 256 KB | 522 | 2024-04-06 08:46:14 |
#include <iostream> #include <stack> #include <string> using namespace std; stack <char> a; string res; int main() { string s; getline(cin, s); int len = s.size(); for(int i = 0; i < len; i++) { if(s[i] == '@') { while(!a.empty()) a.pop(); } else if(s[i] == '#') { if(!a.empty()) a.pop(); } else a.push(s[i]); } int cur = 0; while(!a.empty()) { res[++cur] = a.top(); a.pop(); } for(int i = cur; i >= 1; i--) cout << res[i]; cout << endl; return 0; }