Advertisement
Guest User

Time + 15 Minutes

a guest
Mar 15th, 2016
1,093
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.82 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_15_Minutes
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             var hours = int.Parse(Console.ReadLine());
  14.             var mins = int.Parse(Console.ReadLine()) + 15;
  15.            
  16.             if (mins > 59)
  17.             {
  18.                 hours += 1;
  19.                 mins = mins - 60;
  20.                 Console.WriteLine("{0}:{1:00}", hours, mins);
  21.             }
  22.             else if (hours > 23)
  23.             {
  24.                 hours = hours - 24;
  25.                 Console.WriteLine("{0}:{1:00}", hours, mins);
  26.             }
  27.             else
  28.             {
  29.                 Console.WriteLine("{0}:{1:00}", hours, mins);
  30.             }
  31.         }
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement