백준 #20215번 Cutting Corners

jhj·2024년 2월 13일

백준 JAVA

목록 보기
266/583
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		
		int w = sc.nextInt();
		int h = sc.nextInt();
		double p = Math.sqrt(w * w + h * h);
		
		System.out.println(String.format("%.9f", w + h - p));
		sc.close();
	}
}

제곱근을 구하는 방법 - Math.sqrt(n);

profile
개발자를 꿈꾸는

0개의 댓글