Advertisement
EmoRz

Add15Minute

Jun 22nd, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.68 KB | None | 0 0
  1. using System;
  2.  
  3. namespace TimePlusFiftheenMin
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int hour = int.Parse(Console.ReadLine())*60;
  10.             int min = int.Parse(Console.ReadLine())+15;
  11.             var all = hour + min;
  12.             var inHours = all / 60;
  13.             var inMin = all % 60;
  14.             if (inHours>23)
  15.             {
  16.                 inHours = 0;
  17.             }
  18.             if (inMin<10)
  19.             {
  20.                 Console.WriteLine(inHours + ":0" + inMin);
  21.             }
  22.             else
  23.             {
  24.                 Console.WriteLine(inHours + ":" + inMin);
  25.             }            
  26.         }
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement