Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- 리눅스
- springboot
- docker
- 호이스팅
- IntelliJ
- mssql
- Javascript
- 자바
- 명령어
- mysql
- github
- 404error
- java
- git
- SQL
- 오블완
- isNotEmpty
- analytics4
- oracle
- zset
- spring
- pandas
- 티스토리챌린지
- datagrip
- iBatis
- DBMS
- Kibana
- Linux
- PostgreSQL
- Python
Archives
- Today
- Total
hanker
백준(1085) JAVA - 직사각형에서 탈출 본문
반응형
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int x = sc.nextInt();
int y = sc.nextInt();
int w = sc.nextInt();
int h = sc.nextInt();
int xLen = Math.min(x, w-x);
int yLen = Math.min(y, h-y);
System.out.println(Math.min(xLen, yLen));
}
}
반응형
'Study > ALGORITHM' 카테고리의 다른 글
백준(4153) JAVA - 직각삼각형 (0) | 2021.06.29 |
---|---|
백준(3009) JAVA - 네 번째 점 (0) | 2021.06.29 |
백준(9020) JAVA - 골드바흐의 추측 (0) | 2021.06.24 |
백준(4948) JAVA - 베르트랑 공준 (0) | 2021.05.12 |
백준(1929) JAVA - 소수 구하기 (0) | 2021.05.12 |