#include <stdio.h>
static long str2int(const char* str)
{
long temp = 0;
const char* p = str;
if(str == NULL) return 0;
if(*str == '-' || *str == '+')
{
str ++;
}
while( *str != 0)
{
if( *str < '0' || *str > '9')
{
break;
}
temp = temp*10 +(*str -'0');
str ++;
}
if(*p == '-')
{
temp = -temp;
}
return temp;
}
long Num = 0;
int main(void)
{
//char strs[]="20201019181413";
char strs[]="20201019181413";
Num = str2int(strs);
printf("%ld\r\n",Num);
return 0;
}