#C14903. Calculate the Absolute Difference in Days Between Two Dates
Calculate the Absolute Difference in Days Between Two Dates
Calculate the Absolute Difference in Days Between Two Dates
You are given two dates in the format YYYY-MM-DD
. The task is to calculate the absolute difference in days between these two dates. Use the formula $$\text{days} = \left| (d_2 - d_1) \right|$$ where $$d_1$$ and $$d_2$$ are the dates provided. The input will be read from the standard input (stdin) and the result should be printed to the standard output (stdout).
inputFormat
The input consists of two lines. The first line contains the first date and the second line contains the second date. Both dates are in the format YYYY-MM-DD
.
outputFormat
Output a single integer which is the absolute number of days between the two dates.## sample
2023-10-01
2023-10-01
0