热门

最新

红包

立Flag

投票

同城

我的

发布
qq_55890213
一个简单人物17363
5 年前
trueqq_55890213

练习3-4
统计字符
#include<stdio.h>

int main()
{ int letter,blank,digit,other;
char ch;
int i;
letter=blank=digit=other=0;
for(i=1;i<=10;i++)
{ch= getchar();
if(ch>='A'&&ch<='z')
letter++;
else if(ch==' '||ch=='\n')
blank++;
else if(ch>='0'&&ch<='9')
digit++;
else
other++;
}
printf(" letter=%d blank=%d digit=%d other=%d",letter,blank,digit, other);
return 0;
}

CSDN App 扫码分享
分享
评论
点赞
打赏
  • 复制链接
  • 举报
下一条:
CSDN博文里面的动图怎么弄的呀 麻烦知道的大哥说一下呗
立即登录