fork download
  1. #include <stdio.h>
  2.  
  3. #define cube(x) (x)*(x)*(x)
  4. int main () {
  5. int a, b, c, max = 0;
  6.  
  7. for (a = 0; a < 10; a++) {
  8. for (b = 0; b < 10; b++) {
  9. for (c = 0; c < 10; c++) {
  10. if ((cube(a) + cube(b) + cube(c)) == (100*a + 10*b + c)) {
  11. max = 100*a + 10*b + c;
  12. }
  13. }
  14. }
  15. }
  16.  
  17. printf ("%d\n", max);
  18. return 0;
  19. }
Success #stdin #stdout 0s 2292KB
stdin
Standard input is empty
stdout
407