Run ID:159660

提交时间:2026-09-06 10:22:55

#include<bits/stdc++.h> using namespace std; int main(){ string s; getline(cin,s); int q=s.size(),c=0,t=0; for(int i=0;i<q;i++){ if(s[i]!=' ') c++; if(s[i]==' '||i==q-1){ t+=c; for(int j=1;j<=c;j++){ cout<<s[t-j]; } if(i!=q-1) cout<<s[i]; t++; c=0; } } if(s[q-1]==' ') cout<<' '; return 0; }