1 int my_atoi(const char *str) 2 { 3 assert(str != NULL); 4 int flag = 1; 5 int result = 0; 6 while(*str == ' ' || *str == ' ' || *str == ' ') 7 { 8 ++str; 9 } 10 if(*str == '-') 11 { 12 flag = -1; 13 ++str; 14 } 15 else if(*str == '+') 16 { 17 ++str; 18 } 19 while(*str != '