Dev.baelanche

[백준 2753] 윤년 본문

Data Structure & Algorithm/PS - JAVA

[백준 2753] 윤년

baelanche 2019. 6. 25. 23:00
반응형

 

국어문제에 가깝다.

 

public class Main {
    
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        
        int n = sc.nextInt();
        
        if(n % 4 == 0 && n % 100 != 0)
            System.out.println(1);
        else if(n % 400 == 0)
            System.out.println(1);
        else
            System.out.println(0);
    }
}
반응형

'Data Structure & Algorithm > PS - JAVA' 카테고리의 다른 글

[백준 10870] 피보나치 수 5  (0) 2019.06.25
[백준 2562] 최댓값  (0) 2019.06.25
[백준 2588] 곱셈  (0) 2019.06.25
[백준 10171] 고양이  (0) 2019.06.25
[백준 15683] 감시  (0) 2019.06.25
Comments