07/09/26 23:53:34
空気を読まずにマトモなやつを
#include<ctype.h>
int atoi_(const char*str){
int sign = 0;
int value= 0;
while(isspace(*str))++str;
if(*str == '+')++str;
else if(*str == '-')sign = 1,++str;
for(;isdigit(*str);++str){
value *= 10;
value += *str-'0';
}
if(sign)value = -value;
return value;
}