/**
 * A Pythagorean triplet is a set of three natural numbers, a < b < c, for which,
 * a^2 + b^2 = c^2
 * For example, 32 + 42 = 9 + 16 = 25 = 52.
 * There exists exactly one Pythagorean triplet for which a + b + c = 1000.
 *
 * Find the product abc.
 *
 * @author David Clutter
 */
public class Problem0009 {

    public static void main(final String[] args) {
        for (int a = 1; a < 1_000; ++a) {
            for (int b = a + 1; 1_000 - a - b > b; ++b) {
                final int c = 1_000 - a - b;
                final long aSquared = (long) Math.pow(a, 2);
                final long bSquared = (long) Math.pow(b, 2);
                final long cSquared = (long) Math.pow(c, 2);
                if (aSquared + bSquared == cSquared) {
                    System.out.println("a=" + a + " b=" + b + " c=" + c);
                    System.out.print(a * b * c);
                    System.exit(0);
                }
            }
        }
    }
}
@@ -78,19 +78,16 @@
 r which,
-%0A *
  a%5E2 + b
@@ -94,19 +94,17 @@
 %5E2 = c%5E2
-%0A *
+.
  For exa
@@ -112,15 +112,23 @@
 ple,
+%0A *%0A *
  3
+%5E
 2 + 4
+%5E
 2 = 
@@ -146,11 +146,15 @@
  = 5
+%5E
 2.%0A
+ *%0A
  * T

fix typos