Run ID:151306

提交时间:2026-04-11 16:34:50

#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; }