Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
141621 | 吴晨曦 | 行编辑程序 | C++ | 运行出错 | 21 | 1 MS | 320 KB | 401 | 2024-04-06 09:05:16 |
#include <bits/stdc++.h> using namespace std; int main() { string ans, t; cin >> t; for (int i = 0; i < t.size(); i++) { ans += t[i]; if (t[i] == '#') ans.replace(ans.size() - 2, 2, ""); else if (t[i] == '@') { for (int j = ans.size() - 1; j >= 0; j--) if (j == ' ') break; else ans.replace(j - 1, 1, ""); } } cout << ans << endl; return 0; }