| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 160621 | 赵乐骏 | 字符串反转 | C++ | Presentation Error | 7 MS | 276 KB | 642 | 2026-09-24 21:48:51 |
#include<bits/stdc++.h> using namespace std; int main(){ int T; cin >> T; cin.ignore(); while (T--) { string line; getline(cin, line); string word = ""; string result = ""; for (int i = 0; i <= line.size(); i++) { if (i == line.size() || line[i] == ' ') { reverse(word.begin(), word.end()); if (!result.empty()) result += " "; result += word; word = ""; } else { word += line[i]; } } cout << result << endl; } return 0; }