#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')||(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;

}

转载于:https://www.cnblogs.com/lvdingding13588022785/p/3353181.html

Logo

开放原子开发者工作坊旨在鼓励更多人参与开源活动,与志同道合的开发者们相互交流开发经验、分享开发心得、获取前沿技术趋势。工作坊有多种形式的开发者活动,如meetup、训练营等,主打技术交流,干货满满,真诚地邀请各位开发者共同参与!

更多推荐