# 有一篇文章，共有三行文字，每行有80个字符。要求分别统计出其中英文大写字 母、小写字母、 、数字、空格以及其他字符的个数（本题是教材第6章第10题） 。C语言

、数字、空格以及其他字符的个数（本题是教材第6章第10题）

``#include <stdio.h>#include <string.h>int main(){    char ch[3][81];    int i, j, sum = 0, sum1 = 0, sum2 = 0, sum3 = 0, sum4 = 0, sum5 = 0;    for (i = 0; i < 3; i++)    {        for (j = 0; j < 81; j++)        {            scanf("%c", &ch[i][j]);            if (ch[i][j] == '\n')                break;        }        ch[i][j] = '\0';      }    for (i = 0; i < 3; i++)    {        sum = sum + strlen(ch[i]);        for (j = 0; ch[i][j] != '\0'; j++)        {            if (ch[i][j] >= 'A' && ch[i][j] <= 'Z')                sum1 = sum1 + 1;            else if (ch[i][j] >= 'a' && ch[i][j] <= 'z')                sum2 = sum2 + 1;            else if (ch[i][j] >= '0' && ch[i][j] <= '9')                sum3 = sum3 + 1;            else if (ch[i][j] == ' ')                sum4 = sum4 + 1;        }    }    sum5 = sum - (sum1 + sum2 + sum3 + sum4);    printf("%d %d %d %d %d\n", sum1, sum2, sum3, sum4, sum5);}``