#include <unistd.h>
#include <stdio.h>
int ft_atoi(char *str);
int ft_atoi(char *str)
{
int res, i, sign;
i = 0;
sign = 1;
res = 0;
if (str[0] == '-')
{
sign = -1;
i++;
}
while (str[i] >= 48 && str[i] <= 57)
{
res = res*10 + (str[i] - '0');
}
return sign*res;
}
int main(void)
{
char str[] = "23";
int rslt = ft_atoi(str);
printf("%d", rslt);
return (0);
}