Advertisement
Guest User

12. Time +15 Minutes

a guest
Dec 24th, 2018
851
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.59 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _12.Time_15Minutes
  4. {
  5.     class Program
  6.     {
  7.         static void Main()
  8.         {
  9.             int hours = int.Parse(Console.ReadLine());
  10.             int minutes = int.Parse(Console.ReadLine());
  11.             minutes = minutes + 15;
  12.  
  13.             if (minutes > 59)
  14.             {
  15.                 minutes = minutes - 60;
  16.                 hours = hours + 1;
  17.             }
  18.            
  19.             if (hours == 24)
  20.             {
  21.                 hours = 0;
  22.             }                    
  23.  
  24.             Console.WriteLine($"{hours}:{minutes:0#}");
  25.         }
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement