Problem: time plus 15 minutes

Write a program that inputs hours and minutes from a 24-hour day and calculates how much it will be after 15 minutes. Print the result in hh: mm format. Hours are always between 0 and 23, and minutes are always between 0 and 59. Hours are written with one or two digits. Minutes are always written with two digits and zero at the front when needed.

Sample Input and Output

Input Output
1
46
2:01
0
01
0:16
23
59
0:14
11
08
11:23
12
49
13:04

Hints and Guidelines

Add 15 minutes and write a few conditions. If minutes are over 59, increase hours with 1 and reduce minutes with 60. Thereby look at the case when hours are over 23. When you print the minutes you should check for zero at the front.

Testing in the Judge System

Test your solution from the example here: https://judge.softuni.bg/Contests/Practice/Index/506#13.

results matching ""

    No results matching ""