fork download
  1. #include <iostream>
  2. #include <cmath>
  3. int main() {
  4.  
  5. std::size_t L = 100;
  6.  
  7. for (std::size_t b = 1; b <= L; b++) {
  8. for (std::size_t a = 1; b >a; a++) {
  9. for (std::size_t x = 1; x<=L; x++) {
  10. for (std::size_t y = 1; y <= L; y++) {
  11. for (std::size_t z = 1; z <= L; z++) {
  12. double A = std::pow((a * a - b * b), x) + std::pow((2 * a * b), y);
  13. double B = std::pow((a * a + b * b), z);
  14.  
  15. if (A == B) {
  16. std::cout << '(' << a << "^2 -" << b << "^2)^" << x << "+(2*" << a << '*' << b << ")^" << y << "=(" << '(' << a << "^2 +" << b << "^2)^" << z << " ";
  17. }
  18. if (A > B) {
  19. break;
  20. }
  21. }
  22. }
  23. }
  24. }
  25. }
  26. return 0;
  27. }
Success #stdin #stdout 4.16s 4564KB
stdin
Standard input is empty
stdout
Standard output is empty