Commit aca38014 authored by Michael's avatar Michael

michael.davityan:exercise_05_20

parent a7490079
......@@ -6,9 +6,15 @@ main()
for (int hypotenuse = 1; hypotenuse <= 500; ++hypotenuse) {
for (int catheter1 = 1; catheter1 <= 340; ++catheter1) {
for (int catheter2 = catheter1; catheter2 <= 483; ++catheter2) {
if (hypotenuse * hypotenuse == catheter1 * catheter1 + catheter2 * catheter2) {
std::cout << hypotenuse << ", " << catheter1 << ", " << catheter2 << std::endl;
if (catheter1 + catheter2 > hypotenuse) {
if (catheter1 + hypotenuse > catheter2 ) {
if (catheter2 + hypotenuse > catheter1) {
if (hypotenuse * hypotenuse == catheter1 * catheter1 + catheter2 * catheter2) {
std::cout << hypotenuse << ", " << catheter1 << ", " << catheter2 << std::endl;
}
}
}
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment