BubaLazi

BackIn30Min

May 29th, 2017
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.62 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 HomeworksConditionalStatments
  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 += 30;
  17.  
  18.             hours += (minutes / 60);
  19.             minutes = minutes % 60;
  20.             if(hours >= 24)
  21.             {
  22.                 hours = 0;
  23.             }
  24.             Console.WriteLine("{0}:{1:D2}", hours, minutes);
  25.  
  26.         }
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment