#include
int main(void)
{
char s;
int k=0,g=0;
while((s=getchar())!='$')
{
if(s==' ')
k++;
else if(s>='0'&&s<='9')
g++;
}
printf("the space have %d\tthe number have %d\n",k,g);
}
#include
#include
#include
#define N 80
int main(void)
{
char s[N] = {0}, *p = s;
int spaceNum = 0, digitNum = 0;
fgets(s, N, stdin);
s[N - 1] = '\0';
while('\0' != *p && '$' != *p)
{
if (isdigit(*p))
{
++digitNum;
}
else if (isspace(*p))
{
++spaceNum;
}
else
{
;
}
++p;
}
printf("spaceNum = %d, digitNum = %d\n", spaceNum, digitNum);
return 0;
}