Advertisement
martinvalchev

Back_in_30_Minutes

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