elesis's haunt

14681 사분면 고르기 본문

백준~문풀 후 최적화 추가~/단계별로 풀어보기

14681 사분면 고르기

elesis 2021. 4. 15. 01:48
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();
        sc.close();
        
        if( x>0 && y>0 ) {
            System.out.print(1);
        } else if( x<0 && y>0 ) {
            System.out.print(2);
        } else if( x<0 && y<0 ) {
            System.out.print(3);
        } else {
            System.out.print(4);
        }
    }
}

 

'백준~문풀 후 최적화 추가~ > 단계별로 풀어보기' 카테고리의 다른 글

2739 구구단  (0) 2021.04.19
2884 알람 시계  (0) 2021.04.15
2753 윤년  (0) 2021.04.15
9498 시험 성적9498 시험 성적  (0) 2021.04.14
1330 두 수 비교하기  (0) 2021.04.14
Comments