import java.util.*; // Test whether three numbers a, b, c entered by the user // form a pythagorean triple, that is a^2 + b^2 == c^2 class PythTest { public static void main(String[] args) { int a, b, c; Scanner in = new Scanner(System.in); // Get a, b, and c from the user System.out.print("Enter a: "); a = in.nextInt(); System.out.print("Enter b: "); b = in.nextInt(); System.out.print("Enter c: "); c = in.nextInt(); // If a^2 + b^2 == c^2, print "Pythogorean triple" // Otherwise, print "NOT a Pythagorean triple" if(a*a + b*b == c*c) System.out.println("Pythagorean triple"); else System.out.println("NOT a Pythagorean triple"); } }