#includestdioh#includemathhint main int abcd = 0; for a = 0; a = 9; a++ for b = 0; b = 9; b++ for c =1 ; c = 9; c++ while a 100 + b 10 + c == powa 3 + powb 3 + powc 3 printfdddnab
#include <stdio.h> #include <math.h>
int main() { int a, b, c;
for (a = 0; a <= 9; a++) {
for (b = 0; b <= 9; b++) {
for (c = 1; c <= 9; c++) {
int num = a * 100 + b * 10 + c;
int sum = pow(a, 3) + pow(b, 3) + pow(c, 3);
if (num == sum) {
printf("%d%d%d\n", a, b, c);
}
}
}
}
return 0;
}
原文地址: https://www.cveoy.top/t/topic/b3id 著作权归作者所有。请勿转载和采集!