Advertisement
TwITe

Untitled

Sep 13th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.47 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5. int main() {
  6.     cout << "yea";
  7.     int a = 32, b = 33, c;
  8.     bool exit_loop = false;
  9.     while (!exit_loop) {
  10.         c = 100;
  11.         for (int i = 100; i > b; i--) {
  12.             c = i;
  13.             if (pow(a,2) + pow(c,2) == 2 * pow(b, 2)) {
  14.                 cout << b;
  15.                 exit_loop = true;
  16.                 break;
  17.             }
  18.         }
  19.         b++;
  20.     }
  21.     cout << "yea";
  22.     return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement