BOJ 1085 직사각형에서 탈출

1 개요[ | ]

BOJ 1085 직사각형에서 탈출


2 C++[ | ]

#include <iostream>
#include <algorithm>
using namespace std;

int getMin(int x, int y, int w, int h) {
    return min(min(x, w-x), min(y, h-y));
}

int main() {
    int x, y, w, h;
    cin >> x >> y >> w >> h;
    cout << getMin(x, y, w, h) << '\n';
}
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}