MCPcopy Create free account
hub / github.com/TheAlgorithms/Go / Problem9

Function Problem9

project_euler/problem_9/problem9.go:17–29  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

15package problem9
16
17func Problem9() uint {
18 for a := uint(1); a < 1000; a++ {
19 for b := a + 1; b < 1000; b++ {
20 c := 1000 - a - b
21
22 if a*a+b*b == c*c {
23 return a * b * c
24 }
25 }
26 }
27
28 return 0
29}

Callers 2

TestProblem9_FuncFunction · 0.85
BenchmarkProblem9Function · 0.85

Calls

no outgoing calls

Tested by 2

TestProblem9_FuncFunction · 0.68
BenchmarkProblem9Function · 0.68