@@ -0,0 +1,955 @@
+/**%0A * A Pythagorean triplet is a set of three natural numbers, a %3C b %3C c, for which,%0A * a%5E2 + b%5E2 = c%5E2%0A * For example, 32 + 42 = 9 + 16 = 25 = 52.%0A * There exists exactly one Pythagorean triplet for which a + b + c = 1000.%0A *%0A * Find the product abc.%0A *%0A * @author David Clutter%0A */%0Apublic class Problem0009 %7B%0A%0A    public static void main(final String%5B%5D args) %7B%0A        for (int a = 1; a %3C 1_000; ++a) %7B%0A            for (int b = a + 1; 1_000 - a - b %3E b; ++b) %7B%0A                final int c = 1_000 - a - b;%0A                final long aSquared = (long) Math.pow(a, 2);%0A                final long bSquared = (long) Math.pow(b, 2);%0A                final long cSquared = (long) Math.pow(c, 2);%0A                if (aSquared + bSquared == cSquared) %7B%0A                    System.out.println(%22a=%22 + a + %22 b=%22 + b + %22 c=%22 + c);%0A                    System.out.print(a * b * c);%0A                    System.exit(0);%0A                %7D%0A            %7D%0A        %7D%0A    %7D%0A%7D

Add Problem0009