【leetcode】Reverse Integer
2013-10-08 20:53
351 查看
class Solution { public: int reverse(int x) { // Note: The Solution object is instantiated only once and is reused by each test case. int newVal=0; while(x!=0) { newVal=newVal*10+x%10; x/=10; } return newVal; } };
相关文章推荐
- Leetcode 7 Reverse Integer
- LeetCode - Reverse Integer
- LeetCode:Reverse Integer
- LeetCode——Reverse Integer
- [LeetCode] Reverse Integer
- LeetCode:Reverse Integer
- leetcode 7 -- Reverse Integer
- [LeetCode]Reverse Integer
- leetcode [007] : Reverse Integer
- Leetcode 7 Reverse Integer
- leetcode_reverse Integer
- Leetcode: Reverse Integer
- Leetcode代码学习周记——Reverse Integer
- LeetCode:Reverse Integer
- LeetCode题解(7)--Reverse Integer
- Leetcode 7 Reverse Integer
- leetcode 7 Reverse Integer
- LeetCode 007 Reverse Integer
- LeetCode7——Reverse Integer
- [LeetCode]Reverse Integer