大虾们,看看这个求回文数的程序对不?
# include <stdio.h>int main(void)
{
int val; //存放待判断的数字;
int m;
int sum = 0;
printf ("请您输入您想要判断的数字!\n");
scanf ("%d", &val);
m = val;
while (m)
{
sum = sum*10+sum%10;
m/=10;
}
if (sum == val)
printf ("yes!\n");
else
printf ("no!\n");
return 0;
}