#include<stdio.h>
#include<stdlib.h>
int JudgeNumberSymmetry(unsigned long ulNumber)
{
unsigned long ulTemp=ulNumber;
unsigned long ulResult=0;
int iMod=0;
while(ulTemp)
{
iMod=ulTemp%10;
ulResult=ulResult*10+iMod;
ulTemp=ulTemp/10;
}
if(ulResult==ulNumber)
return 1;
else
return 0;
}
int main()
{
int a;
unsigned int num;
printf("input the number:");
scanf("%ld",&num);
a=JudgeNumberSymmetry(num);
if(a==1)
printf("the number %ld is Symmetry!\n",num);
else
printf("the number %ld is not Symmetry!\n",num);
system("pause");
return 0;
}
#include<stdlib.h>
int JudgeNumberSymmetry(unsigned long ulNumber)
{
unsigned long ulTemp=ulNumber;
unsigned long ulResult=0;
int iMod=0;
while(ulTemp)
{
iMod=ulTemp%10;
ulResult=ulResult*10+iMod;
ulTemp=ulTemp/10;
}
if(ulResult==ulNumber)
return 1;
else
return 0;
}
int main()
{
int a;
unsigned int num;
printf("input the number:");
scanf("%ld",&num);
a=JudgeNumberSymmetry(num);
if(a==1)
printf("the number %ld is Symmetry!\n",num);
else
printf("the number %ld is not Symmetry!\n",num);
system("pause");
return 0;
}