C语言数组这一章的题

a.分别统计出下面的内容输入的英文大小写字母,数字,空格及其他字符,

b.统计单词个数,和数值个数。
比如There are 20 birds on the tree。6个单词,一个数20。

"Woman in Love" is a popular song performed by Barbra Streisand and taken from her 1980 album, Guilty. The song was written by Barry and Robin Gibb of the Bee Gees.
  After the success enjoyed by the Bee Gees in the late 1970s, the band was asked to participate in musical endeavors for other artists, and Streisand asked Barry Gibb to write an album for her.


 
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
main()
{
 char string[100];//根据拟从键盘输入的字串的长度需要适当调整,要避免输入的长度超出设定的范围。
 char c;
 int i, num=0,sum=0,word=0; //定义 word 用来指示一个单词是不是结束或新单词是否开始;
 printf("请从键盘输入一行需要查询的英文句子,进行单词数量统计:\n\n");
 gets(string);   //从键盘获得输入的字符串;
 //以下统计句子中的英文字符个数;
 for(i=0;(c=string[i])!='\0';i++) //for循环语句,遍历句子中的每个字符;初始化i=0;若字符c!='\0',即未到达结束符'\0'的话,执行i++;
    {
        if(('A'<=string[i]&&string[i]<='Z')||('a'<=string[i]&&string[i]<='z'))
            sum++;  //以上为条件句,如果字符在A~Z,a~z 范围之内的话,则执行sum++,累加英文字母个数;
    }
 //以下统计句子中的英文单词个数;
  for(i=0;(c=string[i])!='\0';i++) //for循环语句,遍历句子中的每个字符;初始化i=0;若字符c!='\0',即未到达结束符'\0'的话,执行i++;
    {                              //'\0'用作字符串的结束符。它的ASCII数值是0if(c<'A'||c>'Z'&&c<'a'||c>'z')   //设定条件:如果字符 c 遇到A~Z和a~z范围之外其它符号字符的话,包括遇到空格' ';
         word=0;      //上面条件为真时,执行这里,置word=0,表示未遇到单词,或,一个单词已结束,同时也意味着要开始遇到下一个新单词;
    else if(word==0)  //当条件(word==0)为真,执行下面花括号里面的语句;当word==0时,表示未遇到字母,即未遇到单词,或上一个单词已结束;
           {
               word=1;   //那么置word=1,即,表示下一个新单词开始,
               num++;   //执行num++,累加英文单词的个数;
           }
    }
    printf("\n");
    printf("您输入的这句英文句子中共包含%d个英文字符,%d个英文单词。\n",sum,num);
    
}