Advertisement
bacco

Back in 30 Minutes

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