其他分享
首页 > 其他分享> > 2021-11-03

2021-11-03

作者:互联网

21天养成好习惯–10

#include<stdio.h>
int main()
{
int blank=0,digit=0,other=0;
char a;
while((a=getchar())!=’\n’)
{
if(a>=‘1’&&a<=‘9’)
{
digit++;
}
else if(a==’ ')
{
blank++;
}
else
{
other++;
}
}
printf(“blank = %d, digit = %d, other = %d”,blank,digit,other);
return 0;
}

标签:11,03,digit,++,else,int,other,2021,blank
来源: https://blog.csdn.net/m0_63219149/article/details/121129857