#include <cctype>
int my_atoi(const char* p)
{
assert(p != NULL);
bool neg_flag = false;// 符号标记
int res = 0;// 结果
if(p[0] == '+' || p[0] == '-')
neg_flag = (*p++ == '-');
while(isdigit(*p))
res = res*10 + (*p++ - '0');
return neg_flag ? -res : res;
}