윤년 (2753)

유지원·2021년 6월 16일
0

백준OJ

목록 보기
14/32
post-thumbnail

Java 11

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

    public static void main(String[] args) throws IOException {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int year = Integer.parseInt(br.readLine());
        br.close();

        StringBuilder sb = new StringBuilder();

        if (year % 4 == 0 && year % 100 != 0) {
            sb.append("1");
        }
        else if (year % 400 == 0) {
            sb.append("1");
        }
        else {
            sb.append("0");
        }

        System.out.print(sb);

    }
}
profile
👋 https://github.com/ujw0712

0개의 댓글