C语言程序填空

2025-03-10 16:00:24
推荐回答(1个)
回答1:

#include
void main()
{ /**********found**********/
float x = 10000;
int a, b, c, d, e;
while (x <= 99999)
{ /**********found**********/
a = (int)(x) / 10000;
b = ((int)(x)-a * 10000) / 1000;
c = ((int)(x)-a * 10000 - b * 1000) / 100;
d = ((int)(x)-a * 10000 - b * 1000 - c * 100) / 10;
e = (int)(x) % 10;
/**********found**********/
if (a*a*a + b*b*b + c*c*c + d*d*d + e*e*e == 1000)
{
printf("x=%.0f\n", x);
break;
}
x = x + 1;
}
}