Commit 1f20fbb1 authored by Michael's avatar Michael

just commit

parent b0a79544
......@@ -3,7 +3,30 @@
int
main()
{
for (int hypotenuse = 5; hypotenuse <= 500; ++hypotenuse) {
const int LENGTH_LIMIT = 500;
for (int hypotenuse = 5; hypotenuse <= LENGTH_LIMIT; ++hypotenuse) {
for (int catheter1 = hypotenuse - 2; catheter1 < hypotenuse; ++catheter1) {
for (int catheter2 = 2; catheter2 < catheter1; ++catheter2) {
if (hypotenuse * hypotenuse == catheter1 * catheter1 + catheter2 * catheter2) {
std::cout << hypotenuse << ", " << catheter1 << ", " << catheter2 << std::endl;
}
}
}
}
/* for (int hypotenuse = 5; hypotenuse <= 500; ++hypotenuse) {
int firstValue = 2;
for (int catheter1 = hypotenuse - 1; catheter1 > 0; --catheter1) {
if (catheter1 + firstValue < hypotenuse) {
......@@ -16,6 +39,6 @@ main()
}
++firstValue;
}
}
} */
return 0;
}
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