본문 바로가기

Algorithm/Baekjoon

[백준] #14681: 사분면 고르기

import java.util.Scanner;

public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		
		if(a>0 && b>0) {
			System.out.println("1");
		}
		else if(a<0 && b>0) {
			System.out.println("2");
		}
		else if(a<0 && b<0) {
			System.out.println("3");
		}
		else if(a>0 && b<0) {
			System.out.println("4");
		}
		
	}
}

'Algorithm > Baekjoon' 카테고리의 다른 글

[백준] #2480: 주사위 세개  (0) 2022.02.24
[백준] #2525: 오븐 시계  (0) 2022.02.23
[백준] #2753: 윤년  (0) 2022.02.21
[백준] #9498: 시험 성적  (0) 2022.02.21
[백준] #1330: 두 수 비교하기  (0) 2022.02.21