Files
ValueScript/inputs/passing/projEuler/p9.ts
Andrew Morris bc1afa24c4 Add more tests
2023-02-28 15:28:06 +11:00

18 lines
291 B
TypeScript

// test_output! 31875000
export default function main() {
for (let a = 1; a <= 1000; a++) {
for (let b = a; b <= 1000; b++) {
const c = 1000 - a - b;
if (c <= b) {
break;
}
if (a * a + b * b === c * c) {
return a * b * c;
}
}
}
}