long is_backward(long a);
int main()
{
long number,backnumber;
int i;
printf("请输入一个整数:");
scanf("%ld",&number);
backnumber = is_backward(number);
for (i = 1;i <= 7;i++)
{
if (number == backnumber)
{
printf("经过%d次后该数为回数:%d",i,number);
break;
}
number = backnumber + number;
backnumber = is_backward(number);
}
return 0;
}
long is_backward(long a)
{
while(a/10) {
printf("%d", a%10);
a /=10;
}
return a;
}
请输入一个整数:68
84197607080Press any key to continue
你写的有问题,C#写法如下,你可以参考一下,自己转成C
设断点或打印日志来调试
求倒数部分错了