编辑代码

#include <stdio.h>
int main () {
int english_char=0,space_char=0,math_char=0,other_char=0;
    char c;
    while((c=getchar())!='\n')
    {
        if(c>='a'&&c<='z'||c>='A'&&c<='Z')
        {
            english_char++;
        }
        else if(c==' ')
        space_char++;
        else if(c>='0'&&c<='9')
        math_char++;
        else
        other_char++;
    }
    printf("英文字符%d个空格%d个数字%d个其他%d个",english_char,space_char,math_char,other_char);
    return 0;
}