VelizarAvramov

Time + 15 Minutes

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