Run ID:69568

提交时间:2024-04-05 17:27:34

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