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
- 문자 9086
- 백준 문자
- 9498 시험성적
- 백준10171
- 백준10172
- 백준 25314
- 25304 영수증
- Gabia
- 백준 개수 세기
- update 오류
- 지도 이미지
- 자바 최대 최소
- nexacro
- 8393 합
- 톰캣9
- 10172 개
- mybatis update 오류
- tomcat9
- allowMultiQueries
- 배열 최대값 최소값
- 백준 영수증
- 백준 사분면
- 1330 두 수 비교하기
- 2739 구구단
- 자바
- 백준
- 2753 윤년
- 백준 9086
- 배열 최대 최소
- 넥사크로
Archives
- Today
- Total
두두의 메모
[백준] 14681번 사분면 고르기 본문
반응형
- URL
https://www.acmicpc.net/problem/14681
14681번: 사분면 고르기
점 (x, y)의 사분면 번호(1, 2, 3, 4 중 하나)를 출력한다.
www.acmicpc.net
- 문제
- 필자가 제출한 코드
import java.io.*;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int x = Integer.parseInt(br.readLine());
int y = Integer.parseInt(br.readLine());
if(x > 0) {
if(y > 0) System.out.print(1);
else System.out.print(4);
}
else {
if(y > 0) System.out.print(2);
else System.out.print(3);
}
}
}
- 결과
반응형
'코딩테스트' 카테고리의 다른 글
[백준] 9086 문자 (0) | 2023.09.20 |
---|---|
[백준] 10807번 개수 세기 (0) | 2023.09.19 |
[백준] 2753번 윤년 (0) | 2023.08.15 |
[백준] 1330번 두 수 비교하기 - JAVA (1) | 2023.07.19 |
[백준] 10172번 개 - JAVA (1) | 2023.07.19 |
Comments