#include<stdio.h>
int main()
{
char ch;
int speace, num, other,letter;
speace = 0;
num = 0;
other = 0;
letter = 0;
while ((ch = getchar())!='\n')//getchar函数可以把输入的数暂放缓存区并逐个调用执行
{
if ('a' <= ch&&ch <= 'z' || 'A' <= ch&&ch <= 'Z')//判断是否是字母
letter++;
else if (ch >= '0' && ch <= '9')//判断是否是数字
num++;
else if (ch == ' ')//判断是否是空格
speace++;
else //其他的字符
other++;
}
printf("字母%d\t数字%d\t空格%d\t其他%d", letter, num, speace, other);
return 0;
}