【题目】:一个5位数,判断它是不是回文数。即12321是回文数,个位与万位相同,十位与千位相同。
#include<stdio.h>
int main()
{
int a,b,d,e;//万、千、百、十、个位
long x;
printf("Enter an number(10000--99999) \n");
scanf("%ld",&x);
a=x/10000;
b=x%10000/1000;
d=x%100/10;
e=x%10;
if((a==e)&&(b==d))
printf("The number is a huiwen\n");
else
printf("The number is not a huiwen\n");
return 0;
}