bool isPalindrome(int x) { if(x==0)return true; if(x < 0 || !(x%10))return false; int fs = 0; int ft = x; while(ft>fs){ fs*=10; fs+=ft%10; ft/=10; } return (fs == ft || fs/10 == ft);}