标签:c
#include <stdio.h> int main() { char string[50]; char c; int i, num = 0, word = 0; gets(string); for (i = 0; (c = string[i]) != ‘\0‘; i++) { if (c == ‘ ‘) { word = 0; } else if (word == 0) { word = 1; num++; } } printf("word= %d ", num); return 0; }
标签:c
原文地址:http://10706198.blog.51cto.com/10696198/1705361