Back
Close
  • 171

Statement

 Goal

Your program must print formatted string with the number of full years and full months (if there are any greater than 0) and the total number of days between BEGIN and END dates in dd.mm.yyyy format.

Example 1:

Input:
01.01.2000
01.01.2016

Output:
16 years, total 5844 days

Example 2:

Input:
15.12.2014
14.02.2016

Output:
1 year, 1 month, total 426 days

Example 3:

Input:
01.01.2016
18.08.2016

Output:
7 months, total 230 days
Input
Line 1: A date BEGIN in dd.mm.yyyy format.
Line 2: A date END in dd.mm.yyyy format.
Output
Line 1 : Formatted string presenting date difference as "YY day[s], MM month[s], total NN days"
Constraints
BEGINEND
Example
Input
01.01.2000
01.01.2016
Output
16 years, total 5844 days
Solve it

A higher resolution is required to access the IDE

codingame x discord
Join the CodinGame community on Discord to chat about puzzle contributions, challenges, streams, blog articles - all that good stuff!
JOIN US ON DISCORD
Online Participants