Skip to main content

삼각형 빗변구하기double _Math.sqart

#


#



import java.util.Scanner;

 

public class Calhypotenuse {

 

public static void main(String[] args) {

// TODO Auto-generated method stub

double a, b, c;

Scanner scan = new Scanner(System.in);

System.out.println("밑변을 입력하세요 : ");

a = scan.nextDouble();

System.out.println("높이를 입력하세요 : ");

b = scan.nextDouble();

c = Math.sqrt(a * a + b * b);

System.out.println("빗변의 길이는 : " + c + "이다.");



#


Comments