华为机试 题目 : 字符串最后一个单词的长度

简介

简单

code

#include <iostream>
#include <string>
using namespace std;

int main() {
    string res;
    string here;
    while(cin >> res){
        here = res;
    }
    cout << here.size() << endl;;
    return 0;
}
Hope is a good thing,maybe the best of things,and no good thing ever dies.----------- Andy Dufresne
原文地址:https://www.cnblogs.com/eat-too-much/p/14918893.html