#include #include using namespace std;
int main() { string c; getline(cin, c); //输入带空格字符串 int j = 0; do{ int i = j; int counter = 0; while (c[i] != ' ' && c[i] != '.') { counter++; i++; } cout << counter << " "; j += counter + 1; } while (c[j - 1] != '.'); //保证到“.”结束 return 0; }