Package net.n1da.dev.euler
Class PE0009
- java.lang.Object
-
- net.n1da.dev.euler.core.Problem
-
- net.n1da.dev.euler.PE0009
-
- All Implemented Interfaces:
Solvable
public class PE0009 extends Problem
Solution for problem 9 "Special Pythagorean triplet" completed on Fri, 10 Apr 2015, 14:50.- Since:
- 10.04.2015 14:42:04
- Author:
- Nico Danneberg
- See Also:
- Problem @ Project Euler, Solution @ Ni-Da-Net
-
-
Method Detail
-
solve
public java.lang.String solve()
Since a + b + c = 1000 has to be true, this method runs two nested loops. The outer loop from a = 1 to 999 and the inner one from b = a to 999. c is calculated as 1000 - a - b and the triplet is checked to be an Pythagorean.- Returns:
- the product of the Pythagorean triplet
- See Also:
Mathe.isPythagoreanTriplet(int, int, int)
, Pythagorean triple @ Wikipedia
-
-