| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 160552 | 字符串反转 | C++ | Presentation Error | 6 MS | 272 KB | 687 | 2026-09-22 20:02:13 |
#include <iostream> #include <sstream> #include <string> #include <algorithm> int main() { int T; std::cin >> T; std::cin.ignore(); // 吃掉第一行末尾的换行符 while (T--) { std::string line; std::getline(std::cin, line); std::istringstream iss(line); std::string word; bool first = true; while (iss >> word) { std::reverse(word.begin(), word.end()); if (!first) { std::cout << " "; } std::cout << word; first = false; } std::cout << std::endl; } return 0; }