Run ID:160262
提交时间:2026-09-13 15:30:41
#include<bits/stdc++.h> using namespace std; string s; int main(){ getline(cin,s); int len=s.size(); int cnt=0; for(int i=0;i<len;i++){ if(s[i]!=' '){ cnt++; } else if(s[i]==' '){ for(int j=1;j<=cnt;j++){ cout<<s[i-j]; } cout<<" "; cnt=0; } } return 0; }