is Pythagorean Triplet - Java java.lang

Java examples for java.lang:Math Geometry

Description

is Pythagorean Triplet

Demo Code


//package com.java2s;

public class Main {
    public static boolean isPythagoreanTriplet(int a, int b, int c) {
        return (isPythagorean(a, b, c) && (a + b + c == 1000));
    }/*from   ww w. j a va  2s.c o  m*/

    public static boolean isPythagorean(int a, int b, int c) {
        return ((a * a) + (b * b)) == (c * c);
    }
}

Related Tutorials