Run ID:82367
提交时间:2024-07-13 11:05:00
#include<bits/stdc++.h> using namespace std; int main(){ string s; getline(cin,s); int len=s.size(); int k=0; for(int i=0;i<len;i++){ if(s[i]!=' '){ k++; }else if(s[i]==' '){ if(k!=0){ cout<<k<<','; k=0; } } } cout<<k; return 0; }