Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
151306 李鸣 破译邮件 C++ Accepted 1 MS 276 KB 1063 2026-04-11 16:34:50

Tests(1/1):


Code:

#include <iostream> #include <string> using namespace std; int main() { int C; cin >> C; cin.ignore(); // 吃掉换行 while (C--) { string s; getline(cin, s); string num; for (char c : s) { if (c == '-') { if (!num.empty()) { cout << char(stoi(num) + 'A' - 1); num.clear(); } } else if (c == '#') { if (!num.empty()) { cout << char(stoi(num) + 'A' - 1); num.clear(); } cout << ' '; } else // 数字 { num += c; } } // 处理最后一个数字 if (!num.empty()) { cout << char(stoi(num) + 'A' - 1); } cout << endl; } return 0; }