#include <iostream> #include <ostream> #include <string> using namespace std; int main() { string str; while (getline(cin, str)) { // 注意 while 处理多个 case int res = 0; int clr_flag = 0; for (int i = 0; i < str.size(); i++) { if (str[i] == ' ') { clr_flag = 1; } else { if (clr_flag) { res = 0; clr_flag = 0; } res++; } } cout << res << endl; } } // 64 位输出请用 printf("%lld")