挑战的第一关我都过不去,我不知道是我写的代码有问题还是怎么回事,我的代码是这样的:
[mw_shl_code=c,true]
#include <stdio.h>
#define cube(x) (x)*(x)*(x)
int main () {
int a, b, c, max = 0;
for (a = 0; a < 10; a++) {
for (b = 0; b < 10; b++) {
for (c = 0; c < 10; c++) {
if ((cube(a) + cube(b) + cube(c)) == (100*a + 10*b + c)) {
max = 100*a + 10*b + c;
}
}
}
}
printf ("%d\n", max);
getch ();
return 0;
}[/mw_shl_code]
|