Run ID:8397

提交时间:2025-11-04 20:24:55

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