#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/*
输入一行字符,分别统计出其中英文字母、空格、数字和其它字符的个数。
*/
int main10()
{
char c;
int letter = 0, space = 0, digit = 0, other = 0;
while ((c = getchar())!='\n')
{
if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'))
{
letter++;
}
else if (c == ' ')
{
space++;
}
else if ( c >= '0' && c <= '9')
{
digit++;
}
else
{
other++;
}
}
printf("字母个数:%d\n空格个数:%d\n数字个数:%d\n其他字符个数:%d\n", letter, space, digit, other);
return 0;
}