Amazon interview question

code the atoi function in whatever language you want