#P5711. Leap Year Checker
Leap Year Checker
Leap Year Checker
Given an integer representing a year, determine whether it is a leap year according to the rules established since 1582.
The criteria are as follows:
- Common Leap Year: The year is a leap year if it is divisible by \(4\) and not divisible by \(100\) (e.g., 2004, 2020).
- Century Leap Year: If the year is a century (divisible by \(100\)), it is a leap year only if it is divisible by \(400\) (e.g., 1900 is not a leap year, whereas 2000 is a leap year).
Output 1 if the year is a leap year, otherwise output 0.
inputFormat
The input consists of a single integer on one line representing the year.
outputFormat
Output a single integer: 1
if the year is a leap year, and 0
otherwise.
sample
2004
1