heatherhb

Problem 9 v5

May 22nd, 2011
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.44 KB | None | 0 0
  1. int a = 1;
  2. int b = 1;
  3. int c = 1;
  4.  
  5. for(a = 1; a < 400; a++) {
  6.         for(b = 1; b < a; b++) {
  7.             c = sqrt(pow(a, 2) + pow(b, 2));
  8.             if(a + b + c == 1000) {
  9.                 cout << "a: " << a << endl;
  10.                 cout << "b: " << b << endl;
  11.                 cout << "c: " << c << endl;
  12.                 cout << sqrt(pow(a, 2) + pow(b, 2)) << endl;
  13.                 cout << a*b*c << endl;
  14.             }
  15.         }
  16.     }
Advertisement
Add Comment
Please, Sign In to add comment