計算字符串最後一個單詞的長度,單詞以空格隔開

#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 !=
相關文章
相關標籤/搜索