Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace _14.Time_Plus_15_Minutes
- {
- class TimePlus15Minutes
- {
- static void Main(string[] args)
- {
- int hour = int.Parse(Console.ReadLine());
- int minutes = int.Parse(Console.ReadLine());
- int addMinutes = minutes + 15;
- if (addMinutes>59)
- {
- hour++;
- addMinutes -= 60;
- if (hour > 23)
- {
- hour = 0;
- }
- Console.WriteLine("{0}:{1:00}", hour, addMinutes);
- }
- else
- {
- Console.WriteLine("{0}:{1:00}",hour,addMinutes);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement