main()
{ int c;
int letter=0,digit=0,space=0,other=0;
printf("Please input a string:\n");
while ((c=getchar())!='\n')
if (c>='a'&&c<='z'||c>='A'&&c<='Z')
letter++;
else if (c>='0'&&c<='9')
digit++;
else if (c==' ')
space++;
else
other++;
printf("letter=%d, ",letter);
printf("digit=%d, ",digit);
printf("space=%d, ",space);
printf("other=%d\n",other);
}