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