본문 바로가기

PROGRAMMING/예제

[Java] 윤년 계산하기

public class Example {
	public static void main (String [] s) {
    	
        int year = 2000;
        
        boolean isLeapYear = false;
		if(year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {
			isLeapYear = true;
		}
    }
}

 

You can change the value of variable year.