97. Days Between Two Dates
Challenge1000 ms256 MBSolved by 0%
Read two dates, each as d m y on its own line, and print how many days
apart they are. The answer is never negative — the dates may come in either order.
Remember the leap year rule: divisible by 4, except centuries, unless divisible by 400.
Constraints - `1900 ≤ y ≤ 2100` - Both dates are valid calendar dates.
Input
Two lines, each containing three integers d m y.
Output
Print one integer — how many days apart the two dates are. Never negative.
Input1 1 2024
2 1 2024
Output1
Noteis one day apart
Input1 1 2024
1 1 2024
Output0
Noteis the same date twice
Hint 1Approach
Hint 2Approach
Hint 3Pseudocode
Hint 4Full solution