【leetcode】字符串中的单词数

 

int countSegments(char * s){ int count=0; char* tok; tok = strtok(s," "); while (tok) { count++; tok = strtok(NULL, " "); } return count; }
相关文章
相关标签/搜索