#C12658. Next Date Calculator
Next Date Calculator
Next Date Calculator
Given a date in the format DD-MM-YYYY
, your task is to compute the next date. Make sure to account for leap years and the different numbers of days in each month. The output should also be in the same format DD-MM-YYYY
.
You are required to read the input from standard input (stdin) and write the answer to standard output (stdout).
The formula for determining a leap year is given by:
\(\text{A year is a leap year if } (year \% 4 == 0 \ \text{and}\ (year \% 100 != 0)) \ \text{or} \ (year \% 400 == 0)\).
inputFormat
A single line containing a date string in the format DD-MM-YYYY
.
outputFormat
A single line containing the next date in the format DD-MM-YYYY
.
28-02-2020
29-02-2020