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;
}

上一篇:5.Java数据类型


下一篇:总结和背诵一下常用的模板了... 尽量一样吧.