- char words[100][25];
- int spstr(char *s)
- {
- int i=0,p=0;
- while(s[p] != 0)
- {
- sscanf(s+p,"%s",words[i]);
- p += (strlen(words[i]));
- while(s[p] == ' ') p++;
- i++;
- }
- return i;
- }
- //该片段来自于http://www.codesnippet.cn/detail/251220138213.html
来源: http://www.codesnippet.cn/detail/251220138213.html