#include<stdio.h>
#include<ctype.h>
int main()
{
char ch;
int a=0,b=0,c=0,d=0,e=0;
printf("Input a string:");
while((ch=getchar())!='\n')
{
if( islower(ch) )
a++;
else if(isupper(ch))
b++;
else if( isdigit(ch))
c++;
else if( ispunct(ch) )
d++;
else
e++;
}
printf("大写字母数是:%d\n",b);
printf("小写字母数是:%d\n",a);
printf("空格为:%d\n",d);
printf("数字为:%d\n",c);
printf("其他字符为:%d\n",e);
}