3-7

#include<stdio.h>
int main(void)
{
    int digit,letter,other;
    char ch;
    int i;
    digit=letter=other=0;
    printf("Enter 10 characters:");
    for(i=1;i<=10;i++){
        ch=getchar();
        if(ch>='a'&&ch<='z')
            letter++;
        else if(ch>='0'&&ch<='9')
            digit++;
        else
            other++;
    }
    printf("letter=%d,digit=%d,other=%d\n",letter,digit,other);

    return 0;
}

posted @ 2013-10-05 18:48  傻子疯子捏子  阅读(116)  评论(0编辑  收藏  举报