LeetCode刷题记录2-求32位整数的反序
来源:互联网 发布:电子相册软件源码 编辑:程序博客网 时间:2023/12/03 09:25
题目
Example 1:
- Input: 123
- Output: 321
Example 2:
- Input: -123
- Output: -321
Example 3:
- Input: 120
- Output: 21
在这里给出一个比较精悍的C++实现方法:
int reverse(int x){ long res = 0; while (x) { res = res * 10 + x % 10; x /= 10; } return (res<INT_MIN || res>INT_MAX) ? 0 : res;}
阅读全文
0 0
- LeetCode刷题记录2-求32位整数的反序
- leetcode刷题记录
- leetcode刷题记录
- leetcode刷题记录
- leetcode 刷题记录
- leetcode刷题记录
- Leetcode刷题记录
- Leetcode刷题记录
- leetcode 刷题记录
- LeetCode刷题记录
- 【LeetCode刷题记录】
- LeetCode刷题记录1-求容器的任意2个元素和某一值的下标
- LeetCode刷题记录3-求数字是否为回文
- leetCode 刷题记录 Candy
- LeetCode 刷题记录 目录
- leetcode 做题记录2
- Leetcode刷题记—— 69. Sqrt(x)(求整数x的平方根)
- LeetCode刷题记录4-有效的括号
- 计算机核心概念 —— 服务
- Oracle 创建用户并分配角色
- LEETCODE3. Longest Substring Without Repeating Character
- 2017CCPC哈尔滨 F:Permutation(构造)
- 程序员不能错过的28份技术知识图谱,你的进阶路上必备
- LeetCode刷题记录2-求32位整数的反序
- 设计模式-策略模式(对象行为型)
- MyISAm与InonoDB区别
- 用跨界的知识解决问题
- 学生学号判断专业班级
- ajax轮询在压测平台中的应用
- Unity入门
- c#派生类转换为基类的意义
- Vue devtools 安装 ---亲测可用