kirililchev3

Back into 30 minutes

May 17th, 2018
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.47 KB | None | 0 0
  1. using System;
  2.  
  3.     class Program
  4.     {
  5.         private static void Main()
  6.         {
  7.         int hours = int.Parse(Console.ReadLine());
  8.         int minutes = int.Parse(Console.ReadLine());
  9.  
  10.         minutes += 30;
  11.  
  12.         if (minutes > 59)
  13.         {
  14.             hours += 1;
  15.             minutes -= 60;
  16.         }
  17.         if (hours == 24)
  18.         {
  19.             hours = 0;
  20.         }
  21.         Console.WriteLine($"{hours}:{minutes:d2}");
  22.            
  23.         }
  24.     }
Advertisement
Add Comment
Please, Sign In to add comment