Scanner sc = new Scanner( System.in );
double a = sc.nextDouble();
double b = sc.nextDouble();
// Math.sqrt() vrací druhou odmocninu
double c = Math.sqrt( a * a + b * b );
System.out.println( "Pravoúhlý trojúhelník:" );
System.out.printf( "odvěsny: %f %f%n", a, b );
System.out.printf( "přepona: %f%n", c );