【leetcode】字符串中的單詞數

 

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