bool palindrome(int b)
{
int k = 0;
char a[1000];
do {
int c;
c = b % 10;
char d;
for (int i = 0; i <= 9; i++) {
if (c == i) {
d = '0' + i; break;
}
}
a[k++] = d;
b = b / 10;
} while (b != 0);
// k = 字符长度
int j = 0;
if (k == 1) {
return true;
}
else {
for (int i = 0; i < k / 2; i++) {
if (a[i] != a[k - 1 - i]) {
return false;
j = 1;
break;
}
}
if (j == 0) {
return true;
}
}
}