https://leetcode-cn.com/problems/palindrome-number/
#include<stdio.h>
#include<stdbool.h>
bool isPalindrome(int x){
int len = 1;
int xx= x;
int num1 = 1;
int num2 = 1;
if(x < 0){
return false;
}
while(xx/10!=0)
{
len++;
xx = xx/10;
num1*=10;
}
for(int i = 1;i<=len/2;i++){
if((x/num1)%10 != (x/num2)%10)
{
return false;
}
num1/=10;
num2*=10;
}
return true;
}
int main(int argc,char*argv[]){
int x = -1253521;
bool res = isPalindrome(x);
printf("%s\n",res?"true":"false");
}