void main()
{
char *ch="-8mn66";
printf("%d",parseInt(ch));
}
int parseInt(char *ch)
{
int temp=0,neg=0;
while(*ch!=NULL)
{
if(temp==0&&*ch=='-')neg=1;
if(*ch>='0'&&*ch<='9')
{
if(temp==0)
{
temp=*ch-'0';
}
else
{
temp*=10;
temp+=*ch-'0';
}
}
++ch;
}
if(neg==1)temp*=-1;
return temp;
}