Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int a = 1;
- int b = 1;
- int c = 1;
- bool found = false;
- while(a < 400 && !found) {
- while(b < a && !found) {
- c = sqrt(pow(a, 2) + pow(b, 2));
- if (a + b + c == 1000)
- found = true;
- else
- b++;
- }
- a++;
- }
- cout << a*b*c << endl;
Advertisement
Add Comment
Please, Sign In to add comment