Run ID:135865

提交时间:2025-11-08 16:35:48

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