[LeetCode]-009-Palindrome Number

前端之家收集整理的这篇文章主要介绍了[LeetCode]-009-Palindrome Number前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

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

题意:

判断int数是否是回文.

解法:

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

再前后判断是否是回文

注意不能是负数.

代码

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

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

猜你在找的PHP相关文章