Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _15min_Time
- {
- class Program
- {
- static void Main(string[] args)
- {
- int hours = int.Parse(Console.ReadLine());
- int minutes = int.Parse(Console.ReadLine());
- if (minutes > 59)
- {
- hours = hours + 1;
- minutes = minutes - 60;
- }
- else if (minutes > 45)
- {
- hours = hours + 1;
- minutes = minutes - 60;
- }
- else
- {
- minutes = minutes + 15;
- }
- if (hours > 23)
- {
- hours = hours - 24;
- }
- if (minutes < 10)
- {
- Console.WriteLine(hours + ":" + "0" + minutes);
- }
- else
- {
- Console.WriteLine(hours + ":" + minutes);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement