import java.util.Scanner; public class ComputeAngles2 { public static void main( String[] args ) { Scanner in = new Scanner( System.in ); System.out.print( "Please enter the lengths of the three edges: " ); double a = in.nextDouble(); double b = in.nextDouble(); double c = in.nextDouble(); in.close(); double angleA = Math.acos( (a * a - b * b - c * c) / (-2 * b * c) ); double angleB = Math.acos( (b * b - a * a - c * c) / (-2 * a * c) ); double angleC = Math.acos( (c * c - b * b - a * a) / (-2 * b * a) ); System.out.println( "Angle A is " + Math.toDegrees( angleA ) ); System.out.println( "Angle B is " + Math.toDegrees( angleB ) ); System.out.println( "Angle C is " + Math.toDegrees( angleC ) ); } }