int main(void) { char c,eng=0,dig=0,spc=0,ot=0; while ((c=getchar())!='\n') if (isalpha(c)) eng++; else if (isdigit(c)) dig++; else if (isspace(c)) spc++; else ot++; printf("英文字母:%d\n数字:%d\n空格:%d\n其它字符:%d",eng,dig,spc,ot); return 0; } //---------------------------------------------------------------------------