Advertisement
YavorGrancharov

Back_in_30_Minutes

May 26th, 2017
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.85 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 Back_in_30_Minutes
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             var hours = int.Parse(Console.ReadLine());
  14.             var minutes = int.Parse(Console.ReadLine());
  15.  
  16.             minutes = minutes + 30;
  17.  
  18.             if (minutes > 59)
  19.             {
  20.                 hours = hours + 1;
  21.                 minutes = minutes - 60;
  22.             }
  23.  
  24.             if (hours > 23)
  25.             {
  26.                 hours = 0;
  27.             }
  28.  
  29.             if (minutes < 10)
  30.             {
  31.                 Console.WriteLine(hours + ":" + '0' + minutes);
  32.             }
  33.             else
  34.             {
  35.                 Console.WriteLine(hours + ":" + minutes);
  36.             }
  37.         }
  38.     }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement