#include<stdio.h>
int ascii_to_integer(char *str)
{
int i=0,s=0;
for(;str[i]!='\0';i++)
{
if((str[i]>=0)&&(str[i]<=9))
s=10*s+str[i];
else
s=0;
}
return s;
}
int main()
{
char t[10]={1,2,3,4,5};
ascii_to_integer(t);
printf("%d\n",ascii_to_integer(t));
return 0;
}