#include<stdio.h>
#include<string.h>
int Num=0,Word=0,Other=0,P=0;
void main()
{
void ss(char str[]);
char str[10];
scanf("%s",str);
ss(str);
printf("Word is %d\nNumber is %d\nP is %d\nOther is %d\n",Word,Num,P,Other);
}
void ss(char str[])
{
int i;
for(i=0;str[i]!='\0';i++)
{
if(str[i]>=48 && str[i]<=57) Num++;
else if(str[i]==' ') P++;
else if(str[i]>=65 && str[i]<=90 || str[i]>=97 && str[i]<=122) Word++;
else Other++;
}
}
这个不知道哪错了,请编程大拿们仔细告诉我吧,最好讲解讲解