Advertisement
Papasalt

Untitled

Nov 17th, 2020
371
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.33 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. int main() {
  4.     int a, b, c;
  5.  
  6.     for (c = 0; c < 1000; c++) {
  7.         for (b = 0; b < c; b++) {
  8.             for (a = 0; a < b; a++) {
  9.                 if (a + b + c == 1000 && a*a + b*b == c*c) {
  10.                     std::cout << a << "\t" << b << "\t" << c << "\t" << a*b*c << "\n";
  11.                     goto postloop;
  12.                 }
  13.             }
  14.         }
  15.     }
  16. postloop:
  17.     return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement