Run ID:160548

提交时间:2026-09-22 16:55:03

#include <bits/stdc++.h> 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; }