ast_comparator/test/student_data/handout/shlab-handout/cases/50_tsh.c
// returns -1 if fails
// do not check invalid character after first, as ./tshref
1 if fails
do not check invalid character after first, as ./tshref
1 if fails do not check invalid character after first as . / tshref
int _atoi(char* str)
{
	int ret = str[0] - '0';
	if(ret < 0 || ret > 9)
		return -1;
	int i = 1;
	while(1)
	{
		char c = str[i];
		if(c < '0' || c > '9')
			break;
		ret *= 10;
		ret += c - '0';
		i++;
	}
	return ret;
}
int _atoi ( char * str ) { int ret = str [ 0 ] - ' ' ; if ( ret < 0 || ret > 9 ) return -1 ; int i = 1 ; while ( 1 ) { char c = str [ i ] ; if ( c < ' ' || c > ' ' ) break ; ret *= 10 ; ret += c - ' ' ; i ++ ; } return ret ; }
returns -1 if fails
do not check invalid character after first, as ./tshref
returns - 1 if fails do not check invalid character after first as . / tshref