Written by JS970
on
on
1085 - 직사각형에서 탈출
- 난이도: 브론즈 3
- 날짜: 2023년 2월 7일
- 상태: Correct
- 추가 검토 여부: No
solution
- 수를 비교하여 출력만 하면 되는 매우 단순한 문제이다.
code
#include <iostream>
using namespace std;
int main()
{
int x, y, w, h;
cin >> x >> y >> w >> h;
int width, hight;
width = (x < w - x) ? x : w - x;
hight = (y < h - y) ? y : h - y;
int ans = (width < hight) ? width : hight;
cout << ans << endl;
return 0;
}