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