[백준] 14681. 사분면 고르기(브론즈4)

ERror.ASER·2021년 3월 11일
0

백준

목록 보기
33/69
post-thumbnail

백준(브론즈4) - 14681. 사분면 고르기(브론즈4)



풀이

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();
		
		if(x>0 && y>0)
			System.out.println(1);
		else if(x<0 && y>0)
			System.out.println(2);
		else if(x<0 && y<0)
			System.out.println(3);
		else if(x>0 && y<0)
			System.out.println(4);
	}
}
profile
지우의 블로그

0개의 댓글