9. 回文数c

bool isPalindrome(int x) {
char c[1000]={0};
sprintf(c,"%d",x);
int n=strlen(c);
int head=0,tail=n-1;
while(head<=tail){
if(c[head]!=c[tail]) return false;
head++;
tail--;
}
return true;
}
结果:
浙公网安备 33010602011771号