#include <iostream>
#include <string>
using namespace std;
int main()
{
string a[100];
string temp;
int i = 0;
do
{
cin >> temp;
a[i] = temp;
i++;
}
while(temp.find('.') != string::npos);
temp.erase(temp.find('.'));
i--;
for(int j = 0; j <= i; j++)
{
cout << a[j].size() << " ";
}
return 0;
}
while循环是指temp里面包含小数点吧?那么结束条件就是temp里不含小数点了。既然不含小数点, temp.erase(temp.find('.'));的意义是什么呢?find返回值是个负数吧