Advertisement
IvanBorisovG

BackIn30Minutes

Jan 25th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.54 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ConditionalStatementsAndL
  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()) + 30;
  11.            
  12.             if (minutes > 59)
  13.             {
  14.                 hours++;
  15.                 minutes -= 60;
  16.             }
  17.             if (hours > 23)
  18.             {
  19.                 hours = 0;
  20.             }
  21.             Console.WriteLine($"{hours}:{minutes:d2}");
  22.         }
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement