main(){char str[1024];int i,space,word,num,others;space=word=num=others=0;printf("please input (string):");scanf("%s",str);for(i=0,i<1024 && str[i] != '\0';i++){if(str[i]>='0' and str[i]<='9') num++;else if(str[i]>='A' && str[i]<='Z' || str[i]>='a' && str[i]<='z')word++;else if(str[i]==' ')space++;else others++;printf("word:%d\nspace:%d\nnumber:%d\nothers:%d\n",word,space,num,others);}}