颠倒数字法
int isReverse(int n) {int reversed = 0, original = n;while (n > 0) {reversed = reversed * 10 + n % 10;n /= 10;}return original == reversed;
}
字符串比对法
int isReverse(long long n) {char str[12];sprintf(str, "%lld", n);for (int i=0;i<strlen(str)/2;i++) {if (str[i]!=str[strlen(str)-1-i]) {return 0;}}return 1;
}