比如12321是回文数字
#include <iostream>
using namespace std;
#define size 20
void sysmety(long num){
int numnew = num;
int arr[size];
int len = 0;
while(num){
arr[len++] = num%10;
num = num/10;
}
int i=0,j=len-1;
while(i<j&&(arr[i]==arr[j])){
i++;
j--;
}
if(i>=j)
cout<<numnew<<"是回文数字"<<endl;
else
cout<<numnew<<"不是回文数字"<<endl;
}
int main(){
long num=123454321;
sysmety(num);
return 0;
}