Advertisement
Guest User

time_plus_15min

a guest
Sep 12th, 2016
310
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.65 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Time_15Minutes
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int h = int.Parse(Console.ReadLine());
  14.             int m = int.Parse(Console.ReadLine());
  15.             m = m + 15;
  16.  
  17.            
  18.             if (m > 59)
  19.             {
  20.                 h = h + 1;
  21.                 m = m - 60;
  22.             }
  23.             if (h > 23)
  24.             {
  25.                 h = 0;
  26.             }
  27.  
  28.             Console.WriteLine("{0}:{1}", h, m.ToString().PadLeft(2, '0'));
  29.         }
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement