Advertisement
Guest User

Сумма двух кубов

a guest
Jan 24th, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. #include "pch.h"
  2. #include <math.h>
  3. #include <windows.h>
  4. #include <stdio.h>
  5.  
  6. int main()
  7. {
  8. SetConsoleOutputCP(1251);
  9. int x = 1, y = 1, n = 1, k = 0;
  10. float a = 0.3333333;
  11. while (1) {
  12. n++;
  13. {for (x = 1; x <= pow(n, a); x++)
  14. for (y = 1; y <= x; y++)
  15. if (n == x * x*x + y * y*y)
  16. {
  17. k++;
  18. if (k == 2) {
  19. printf("Минимальное число, которое можно представить двумя различными способами в виде суммы двух кубов, равно %d\n", n);
  20. goto founde;
  21. }
  22. }
  23. }
  24. k = 0;
  25. }
  26. founde:
  27. system("pause");
  28. return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement