Run ID:133884
提交时间:2025-10-24 15:59:57
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; cin.get(); for(int i=0;i<n;i++){ string s; getline(cin,s); string word=""; for(int j=0;j<=s.length()-1;j++){ if(s[j]==' '){ cout<<word<<" "; word=""; }else{ word=s[j]+word; } if(j==s.length()-1) cout<<word<<endl; } } return 0; }