Palindrome Number
Palindrome Number
Total Accepted: 95552 Total Submissions: 318732 Difficulty: Easy
Determine whether an integer is a palindrome. Do this without extra space.
class Solution { public: bool isPalindrome(int x) { int y = 0; int tmp = x; while(tmp){ y = y*10+tmp%10; tmp = tmp/10; } return x>=0 && y==x ; } };
写者:zengzy
出处: http://www.cnblogs.com/zengzy
标题有【转】字样的文章从别的地方转过来的,否则为个人学习笔记