#include <iostream> #include <string> using namespace std; int main() { int a, b; string row; while (getline(cin, row)) { // 注意 while 处理多个 case int length = row.size(); string::size_type pos = row.find_last_of(' '); if (pos == string::npos) { cout << length << endl; } else { ...