카테고리 없음
1085번: 직사각형에서 탈출
Beabletoet
2017. 9. 2. 20:17
1 2 3 4 5 6 7 8 9 10 | #include<cstdio> int main() { int x, y, w, h, ans; scanf("%d %d %\d %d", &x, &y, &w, &h); ans = (w - x < x - 0) ? w - x : x - 0; x = (h - y < y - 0) ? h - y : y - 0; ans = (ans < x) ? ans : x; printf("%d", ans); } | cs |