将一个字符串转换成整数需要注意的几点:
1.字符串为空指针
2.非法字符的输入
3.数据溢出
4.正负号
int atoi(char *str) { if(str==NULL) return 0; char *p=str;int sign=1; while(*p!='