#include
#include
void main()
{
char ch[50];
int i,j=0,k=0,m=0,n=0;
printf("请输入一串字符:");
gets(ch);
printf("输入的字符为:");
puts(ch);
for(i=0;i
if(ch[i]>='0'&&ch[i]<='9')
{
j++;
}
else if(ch[i]>='a'&&ch[i]<='z')
{
k++;
}
else if(ch[i]>='A'&&ch[i]<='Z')
{
n++;
}
else if(ch[i]<'0'||ch[i]>'9'&&ch[i]<'A'||ch[i]>'Z'&&ch[i]<'a'||ch[i]>'z')
{m++;}
}
printf("数字个数为:%d\n",j);
printf("小写字母个数为:%d\n",k);
printf("大写字母个数为:%d\n",n);
printf("其他字符个数为:%d\n",m);
}