码迷,mamicode.com
首页 > 其他好文 > 详细

[LeetCode]-009-Palindrome Number

时间:2015-04-30 12:36:59      阅读:126      评论:0      收藏:0      [点我收藏+]

标签:

网址:https://leetcode.com/problems/palindrome-number/

题意:

判断int数是不是回文.

解法:

先遍历一遍,得到数值位数.

再前后判断是不是回文

注意不能是负数.

代码:

https://github.com/LiLane/leetcode/blob/master/c%2B%2B/009-PalindromeNumber-201504300015.cpp

https://github.com/LiLane/leetcode/blob/master/java/009-PalindromeNumber-201504300011.java

[LeetCode]-009-Palindrome Number

标签:

原文地址:http://blog.csdn.net/lane_l/article/details/45392203

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!