Advertisement
Guest User

Time +15 min

a guest
Apr 5th, 2016
141
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 _14.Time_Plus_15_Minutes
  8. {
  9.     class TimePlus15Minutes
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int hour = int.Parse(Console.ReadLine());
  14.             int minutes = int.Parse(Console.ReadLine());
  15.  
  16.             int addMinutes = minutes + 15;
  17.  
  18.             if (addMinutes>59)
  19.             {
  20.                 hour++;
  21.                 addMinutes -= 60;
  22.  
  23.                 if (hour > 23)
  24.                 {
  25.                     hour = 0;
  26.                 }
  27.  
  28.                 Console.WriteLine("{0}:{1:00}", hour, addMinutes);
  29.             }
  30.             else
  31.             {
  32.                 Console.WriteLine("{0}:{1:00}",hour,addMinutes);
  33.             }
  34.         }
  35.     }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement