96. Add Two Times
Core1000 ms256 MBSolved by 0%
Read two times, each as h m s on its own line, and print their sum as
h m s separated by single spaces.
Seconds carry into minutes and minutes carry into hours. Hours wrap around at 24, so
23:00:00 plus 2:00:00 is 1 0 0.
Constraints - `0 ≤ h ≤ 23` - `0 ≤ m ≤ 59` - `0 ≤ s ≤ 59` for both times.
Input
Two lines, each containing three integers h m s.
Output
Print three integers on one line, separated by single spaces, the resulting hours, minutes and seconds, with hours wrapping at 24.
Input1 30 0
2 15 0
Output3 45 0
Noteadds with no carrying at all
Input1 30 45
0 45 30
Output2 16 15
Notecarries from seconds into minutes and from minutes into hours
Hints
Four rungs, in order. The last two open once you have submitted an attempt. A wrong one counts.
Hint 1Where to start
Hint 2The approachOpen hint 1 first. This one carries on from it.
Hint 3PseudocodeOpen hint 2 first. This one carries on from it.
Hint 4Full solutionOpen hint 3 first. This one carries on from it.