fork(1) download
  1. #include <iostream>
  2. #include <cstdio>
  3. using namespace std;
  4. int main()
  5. {
  6. int x, y, z, p, q, r;
  7. scanf ("%d", &x);
  8. for (x; x > 0; --x)
  9. {
  10. scanf ("%d", y);
  11. r = 0;
  12. for (p = 0; p * p * p <= y; ++p)
  13. {
  14. for (q = 0; q * q * q <= y; ++q)
  15. {
  16. if (p * p * p + q * q * q == y)
  17. {
  18. r = r + 1;
  19. break;
  20. }
  21. }
  22. if (r == 1)
  23. {
  24. break;
  25. }
  26. }
  27. }
  28. printf ("%d\n", r);
  29. return 0;
  30. }
Runtime error #stdin #stdout 0s 3296KB
stdin
5
40
35
53
65
27
stdout
Standard output is empty