Run ID:109118

提交时间:2025-01-27 21:54:54

std::string processTestCase(const std::string& testCase) { std::istringstream iss(testCase); std::string word; std::string result; bool firstWord = true; // 分割输入的字符串为单词 while (iss >> word) { // 反转每个单词 std::string reversedWord = reverseWord(word); if (!firstWord) { result += " "; } result += reversedWord; firstWord = false; } return result; }