Class PE0009

    • Constructor Summary

      Constructors 
      Constructor Description
      PE0009()
      A simple constructor to set number and title.
    • Method Summary

      Modifier and Type Method Description
      java.lang.String solve()
      Since a + b + c = 1000 has to be true, this method runs two nested loops.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • PE0009

        public PE0009()
        A simple constructor to set number and title.
    • 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