解题思路:
注意事项:
参考代码:
#include<stdio.h>
int main()
{
int c, space ,number ,character , other;
space = number = character = other =0;
while( (c = getchar())!='\n')
{
if( c == ' ')
{
space++;
}
else if( c >='0'&& c <='9')
{
number++;
}
else if ( (c >='a' && c <= 'z') || ( c >= 'A' && c <= 'Z') )
{
character++;
}
else
{
other++;
}
}
printf("%d %d %d %d",character,space,number,other);
return 0;
}
0.0分
0 人评分