mirror of
https://github.com/voltrevo/ValueScript.git
synced 2026-04-18 03:00:27 -04:00
projEuler9.ts
This commit is contained in:
15
inputs/passing/projEuler9.ts
Normal file
15
inputs/passing/projEuler9.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user