![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
LTCD_1
文章平均质量分 55
灮星
莫吟啸 当力行
展开
-
9.回文数
9.回文数Tips题目代码代码一代码二 Tips 1. Once we need to reverse a number and use the way of: rev = rev * 10 + temp % 10; We have to think if the reverse of the given number will overflow when multiplied by 10. 2. To employ the method of Math: if a number is a Palind原创 2021-07-30 00:42:59 · 88 阅读 · 0 评论 -
7.整数反转
整数反转题目代码代码一代码二 题目 代码 代码一 int reverse(int x){ int rst = 0; while(x){ if(rst < INT_MIN / 10 + x % 10 / 10 || rst > INT_MAX / 10 + x % 10 / 10){ //(x % 10 / 10)is always equal to zero, which can be omitted.原创 2021-07-28 21:33:07 · 65 阅读 · 0 评论