Run ID:158677
提交时间:2026-08-22 16:32:18
#include <iostream> #include <string> #include <sstream> using namespace std; int main() { int C; cin >> C; while (C--) { string s; cin >> s; string ans; string numStr; for (char ch : s) { if (ch == '#') { // 先处理缓存数字 if (!numStr.empty()) { int val = stoi(numStr); ans += (char)('A' + val - 1); numStr.clear(); } ans += ' '; } else if (ch == '-') { if (!numStr.empty()) { int val = stoi(numStr); ans += (char)('A' + val - 1); numStr.clear(); } } else // 数字 { numStr += ch; } } // 处理末尾剩下的数字 if (!numStr.empty()) { int val = stoi(numStr); ans += (char)('A' + val - 1); } cout << ans << endl; } return 0; }