编写一函数,由实参传来一个字符串,统计此字符串中字母、数字、空格和其它字符的个 数,在主函数中输入字符串以及输出上述的结果。请填空完成上述功能的程序。
#include
#include
void fltj(char str[],int a[])
{
int ll,i;
ll= (1)
for (i=0;i<ll;i++)
{ if ( (2) ) a[0]++;
else if ( (3) ) a[1]++;
else if ( (4) ) a[2]++;
else a[3]++;
} }
main()
{ static char str[60];
static int a[4]={0,0,0,0};
gets(str);
fltj(str,a);
printf("%s char:%d digit:%d space:%d other:%d", str,a[0],a[1],a[2],a[3]);
}