题解 | #反序数#
反序数
http://www.nowcoder.com/practice/e0d06e79efa44785be5b2ec6e66ba898
include <stdio.h>
include <math.h>
main()
{
int x, a, b, c, d, y;
for (x = 1000; x < 10000; x++)
{
d=x/1000;
c=(x-d1000)/100;
b=(x-d1000-c100)/10;
a=x%10;
y=(a1000+b100+c10+d);
if (x*9==y)
{
printf("%d\n",x );
break;
}
}
}