就是统计一串字符中数字的个数
但是为啥这没有输出
望指点
'
#include <stdio.h>
#include <math.h>
#include <string.h>
int count(char );
void main(void)
{
int num;
char str[80];
printf("请输入一串字符:");
gets(str);
num=count(str[80]);
printf("数字有%d个",num);
}
int count(char str[80])
{
int i,n=0;
for(i=0;str[i]!='\0';i++)
{
if(str[i]>='0'&&str[i]<='9')
{
n++;
}
}
return n;
}'