1 // 2 // main.c 3 // 统计输入单词数 4 // 5 // Created by LongMa on 2019/6/27. 6 // Copyright © 2019 . All rights reserved. 7 // 8 9 #include <stdio.h> 10 #include <string.h> 11 12 int main(int argc, const char * argv[]) { 13 14 //输入一个英文句子,英文句以空格分隔。统计句子中有多少个单词。 15 //eg:how are you,有3个单词 16 char string[80]; 17 printf("请输入英文句子:"); 18 gets(string); 19 20 char c; 21 char kongGe[2] = " "; 22 int word = 0; 23 int num = 0; 24 25 for (int i = 0; (c = string[i]) != '