Advertisement
Guest User

Untitled

a guest
Jul 16th, 2017
269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.69 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 hour = int.Parse(Console.ReadLine());
  14.             int minutes = int.Parse(Console.ReadLine());
  15.  
  16.             int minutesPlus15 = minutes + 15;
  17.  
  18.             if (minutesPlus15 > 59)
  19.             {
  20.                 hour++;
  21.                 minutesPlus15 -= 60;
  22.             }
  23.             if (hour == 24)
  24.             {
  25.                 hour = 0;
  26.             }
  27.             Console.WriteLine($"{hour}:{minutesPlus15:00}");            
  28.         }
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement