#include<stdio.h>
#include<string.h>
int main()
{
char a[2][80]={0};
int i=0,j=0,d=0,x=0,s=0,k=0,q=0;
for(i=0;i<=2;i++)
gets(a[i]);
for(i=0;i<=2;i++){
for(j=0;j<strlen(a[i]);j++){
if((a[i][j]>='a')&&(a[i][j]<='z'))
x+=1;
else if((a[i][j]>='A')&&(a[i][j]<='Z'))
d+=1;
else if((a[i][j]>='0')&&(a[i][j]<='9'))
s+=1;
else if(a[i][j]==' ')
k+=1;
else q+=1;}
}
printf("%d %d %d %d %d\n",d,x,s,k,q);
return 0;
}
这是代码