Is Date?
Problem Statement
Khaled has an exam in the near future. He wants to record the exam date in his notes.
He wants to make sure that the date is always correct. Create a program for Khaled that will validate the date.
The program should take the year, the month then the day in this order.
If the date is valid, the program should print OK. If the date is not valid, it should print WRONG.
Constraints
- year is an integer between 2000 and 2025 inclusive
- month is an integer between 1 and 12 inclusive
- day is an integer between 1 and 31 inclusive
Input
Input is in the following format:
year
month
day
Output
Print OK if the date is valid or WRONG if the date is not valid.
Samples
Sample 1
Input | Output |
---|---|
2025 1 2 |
OK |
year = 2025 ok
month = 1 ok
day = 2 ok
Sample 2
Input | Output |
---|---|
2020 15 1 |
WRONG |
year = 2020 ok
month = 15 wrong
day = 1 ok
Sample 3
Input | Output |
---|---|
2022 12 40 |
WRONG |
year = 2022 ok
month = 12 ok
day = 40 wrong
Comments