#include <stdio.h>
void main()
{
    int alphabet=0, space=0, digit=0, others=0;
    char ch;
    
    printf("Input a text end of ctrl+z:");
    while((ch=getchar())!= EOF)
    {
        if(ch>='a' && ch<='z' || ch>='A' && ch<='Z')
            alphabet++;
        else if(ch==' ') 
            space++;
        else if(ch>='1' && ch<='9') 
            digit++;
        
        else
            others++;
    }
    printf("alphabet=%d, space=%d, digit=%d, others=%d",alphabet, space, digit, others);
}