判断回文数的,哪里错了???
long recover(long x){long t=0;
while(x>0)
{t=t*10+x%10;
x=x/10;
}
return t;
}
int textx(long x)
{long t,y;y=x;
while(y>0)
{t=t*10+y%10;
y=y/10;
}
if(t==x)return 1;
else return 0;
}
#include<stdio.h>
int main()
{ long x,y,sum;char ch; clrscr();
do
{ do
{
printf("Entre number:");scanf("%d",&x);
if(x<10||x>9999999)
{ printf("Error!");}
y=recover(x);
sum=x+y;
if(sum>800000000)
{ printf("over!");}
if(textx(x)==0)
{ printf("%d+%d=%d",x,y,sum); }
x=sum;
}while(textx(x)==0);
printf("'n' or 'ankey'");
ch=getche();
}while(ch!='n');
return 0;
}