반응형
https://www.acmicpc.net/problem/1085
-문제-
-정답-
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
int x, y, w, h;
cin >> x >> y >> w >> h;
vector<int> arr;
arr.push_back(x - 0);
arr.push_back(w - x);
arr.push_back(y - 0);
arr.push_back(h - y);
sort(arr.begin(), arr.end());
cout << arr[0];
return 0;
}
반응형