Leetcode 8. 字符串转换整数 (atoi)
leetcode 8. 字符串转换整数 (atoi)
https://leetcode-cn.com/problems/string-to-integer-atoi/
请你来实现一个 atoi 函数,使其能将字符串转换成整数。
首先,该函数会根据需要丢弃无用的开头空格字符,直到寻找到第一个非空格的字符为止。
当我们寻找到的第一个非空字符为正或者负号时,则将该符号与之后面尽可能多的连续数字组合起来...
原创
2019-09-08 15:05:56 ·
255 阅读 ·
0 评论