MiroslavKisov

+15 minutes

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