Correct dates P29448


Statement
 

pdf   zip

thehtml

Write a program that reads several dates, and for each one tells if it is correct or not according to the Gregorian calendar.

You can find the rule for leap years in the exercise ‍.

Input

Each date consists of three integer numbers, corresponding to the day, month and year, respectively. All years are between 1800 and 9999.

Output

For every date, tell if it is correct or not.

Public test cases
  • Input

    30 11 1971
    6 4 1971
    4 8 2001
    29 2 2001
    32 11 2005
    30 11 2004
    -20 15 2000
    

    Output

    Correct Date
    Correct Date
    Correct Date
    Incorrect Date
    Incorrect Date
    Correct Date
    Incorrect Date
    
  • Information
    Author
    Jordi Petit
    Language
    English
    Translator
    Carlos Molina
    Original language
    Catalan
    Other languages
    Catalan
    Official solutions
    C++ Java Pascal Python
    User solutions
    C C++ Java Pascal Python