//alphabet 英文字母 ,blank 空格,數字 digit
#include <stdio.h>
int main()
{
char c;
int alphabet=0,blank=0,digit=0,other=0;
printf("請輸入一行字符:\n");
c=getchar();
while(c!='\n')
{
if(c>='A'&&c<='Z'||c>='a'&&c<='z')
alphabet++;
else if(c==' ')
blank++;
else if(c>='0'&&c<='9')
digit++;
else
other++;
c=getchar();
}
printf("字母個數:%d\n空格個數:%d\n數字個數:%d\n其余符號個數:%d\n",alphabet,blank,digit,other);
return 0;
}