牛客网刷题2——字符串最后一个单词的长度

题目

#include <iostream>
#include <string>
 
using namespace std;
 int main()
 {
     string s;
     while(cin>>s)
     {
     }
     cout<<s.length();
     return 0;
 }
发布了52 篇原创文章 · 获赞 29 · 访问量 4万+

猜你喜欢

转载自blog.csdn.net/qq_41122796/article/details/104786886