Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

“字符串转换成整数” 未对字符异常处理 #389

Open
duyu opened this issue Oct 29, 2014 · 0 comments
Open

“字符串转换成整数” 未对字符异常处理 #389

duyu opened this issue Oct 29, 2014 · 0 comments

Comments

@duyu
Copy link

duyu commented Oct 29, 2014

3.非法字符:输入的字符串中可能含有不是数字的字符。因此,每当碰到这些非法的字符,程序应停止转换。

在完整参考代码内并未处理这类非法字符?

if c < 0 or c > 9:
return sign > 0 ? MAX_INT: MIN_INT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant