Palindrome Number
bool isPalindrome(int x) { // Note: The Solution object is instantiated only once and is reused by each test case. if(x<0) return false; int div = 1; while(x/div>=10) { div*=10; } while(x) { int a = x/div; int b = x%10; if(a!=b) return false; x = (x%div)/10; div = div/100; } return true; }优质内容筛选与推荐>>