题样
#include<math.h>
#include<string.h>
int Count_Digit ( char *ptr,int *num )
{
char *p=ptr;
int j=0;
int count=0;
while(*p)
{
if(*p>='0'&&*p<='9')
{
count++;
ptr[j++]=*p;
}
p++;
}
ptr[j]='\0';//count计数结束,数字字符保留结束
int high=j-1,low=0;
char s[1000];
strcpy(s,ptr);
char t;//逆序的准备
while(high>=low)//!!!此处逆序的含义
{
t=s[high];
s[high]=s[low];
s[low]=t;
low++;
high--;
}
int n=count;*num=0;j=0;//字符转int准备
while(n)
{
*num=*num+(s[j++]-'0')*pow(10,n-1);
n--;
}
return count;
}