
整型处理
UmdCoding
这个作者很懒,什么都没留下…
展开
-
7. Reverse Integer
Reverse digits of an integer.Example1: x = 123, return 321 Example2: x = -123, return -321click to show spoilers.Have you thought about this? Here are some good questions to ask before coding. Bonus原创 2016-08-14 12:11:51 · 324 阅读 · 0 评论 -
8. String to Integer (atoi)
Implement atoi to convert a string to an integer.Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible input cases.N原创 2016-08-14 23:04:19 · 306 阅读 · 0 评论 -
9. Palindrome Number
Determine whether an integer is a palindrome. Do this without extra space.判断一个int数是否是回文? 解法:转换为字符串, 字符串判断回文很简单for (int i = 0, j = s.size() - 1; i != s.size() / 2; i++, j--){ if (s[i] != s[j]) re原创 2016-08-15 14:40:40 · 318 阅读 · 0 评论