文章
29
粉丝
598
获赞
17
访问
282.3k
#include<stdio.h>
int main()
{
char ch,a[100];
int zimu=0,shuzi=0,kongge=0,qita=0,i=0;
gets(a);
while(a[i]!='\0')
{
ch=a[i];
if(ch>='A'&&ch<='Z') zimu++;
else if(ch>='a'&&ch<='z') zimu++;
else if(ch>='0'&&ch<='9') shuzi++;
else if(ch==' ') kongge++;
else qita++;
i++;
}
printf("%d %d %d %d",zimu,shuzi,kongge,qita);
return 0;
}
登录后发布评论
暂无评论,来抢沙发