#C14902. Leap Year Determination
Leap Year Determination
Leap Year Determination
Given an integer year
, determine whether it is a leap year. A year is considered a leap year if it satisfies the following conditions:
- The year is divisible by 4: $$ year \mod 4 = 0 $$
- However, if the year is a century (i.e. ends with 00), it must also be divisible by 400: $$ year \mod 400 = 0 $$
In summary, a year is a leap year if and only if ((year % 4 == 0 and year % 100 != 0) or (year % 400 == 0))
.
inputFormat
The input consists of a single integer which represents the year to be evaluated.
outputFormat
Print True
if the given year is a leap year, and False
otherwise.
2020
True