Run ID:136264
提交时间:2025-11-09 23:25:27
#include <iostream> #include <sstream> #include <algorithm> using namespace std; int main() { int T; cin >> T; cin.ignore(); while (T--) { string line; getline(cin, line); stringstream ss(line); string word; bool first = true; while (ss >> word) { reverse(word.begin(), word.end()); if (!first) { cout << " "; } cout << word; first = false; } cout << endl; } return 0; }