#include<stdio.h>
#include<string.h>
int change(char *s,int *p)
{
int i=0,k=0,l;
char str[99];
strcpy(str,s); //复制字符串
l=*p;
printf("str=%s\n",str);
for(i=0;i<l;i++)
{
if(str[i]>='0'&&str[i]<='9')
{
printf("number=%d, str=%c\n",i,str[i]);
k++;
}
}
printf("k=%d\n",k);
return k;
}
main (void)
{
char string[99];
int *p;
int number,j;
j=0;
number=0;
gets(string);
j=strlen(string); //计算字符串长度
p=&j;
number = change(string,p);
printf("number=%d\n",number);
return 0;
}