백준문제풀이 10단계 기하: 직사각형과 삼각형(2) 1085번 직사각형에서 탈출 (C#)
현수가 있는 x,y에서 직사각형의 경계까지에 최소 거리를 구하는 문제이다.직사각형은 0,0 부터 w,h까지인 사각형이다. using System;class BackJoon{ static void Main(string[] args) { string[] input = Console.ReadLine().Split(); int x = int.Parse(input[0]); int y = int.Parse(input[1]); int w = int.Parse(input[2]); int h = int.Parse(input[3]); int v = x; if (w - x 최소값인 경우는 총 4가지이다.x , y , w - ..
2024.06.26