Leap years P43135


Statement
 

pdf   zip

html

Write a program that reads a sequence of years and, for each one, prints if it is a leap year or is not.

A leap year is a year that has 366 days. After the gregorian reform are leap years the multiples of four that do not end with two zeros, and also the years ended in two zeros such that the number without the two final zeros is divisible by four.Thus, 1800, 1900 although being multiples of four, were not leap years; however, the year 2000 was a leap year.

Input

Input is a natural number y between 1800 and 9999.

Output

For each year of the input, print “YES” or “NO” in a line indicating if is a leap year or is not.

Public test cases
  • Input

    2006
    1992
    1900
    2000
    

    Output

    NO
    YES
    NO
    YES
    
  • Information
    Author
    Jordi Petit
    Language
    English
    Translator
    Carlos Molina
    Original language
    Catalan
    Other languages
    Catalan
    Official solutions
    C++
    User solutions
    C++