计算字符串最后一个单词的长度,单词以空格隔开

#include <iostream> #include <string> using namespace std; int Num(char *str) { if (str == nullptr) return 0; char *ptr = str; int num = 0, index = 0, n = 0; while (*ptr !=
相关文章
相关标签/搜索