统计英文字母、空格、数字和其它字符的数目
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int main()
{
char c;
int zimu=0;
int kongge=0;
int shuzi=0;
int other=0;
printf("请输入字符:");
while ((c = getchar())!= '\n')
{
if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z'))
{
zimu++; continue;
}
if (c == ' ')
{
kongge++; continue;
}
if (c > '0' && c < '9')
{
shuzi++; continue;
}
other++;
}
printf("%d %d %d %d", zimu, kongge, shuzi, other);
return 0;
}