Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<cmath>
- using namespace std;
- int main() {
- int c = 1;
- for(int a = 1; a < 1000; a++) {
- for(int b = 1; b < 1000; b++) {
- if(a == b)//one must be less than the other
- b++;
- c = sqrt(pow(a, 2) + pow(b, 2));
- if(a + b + c == 1000)
- cout << a*b*c << endl;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment