SHARE
TWEET

Untitled

ceco_sht Oct 23rd, 2019 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2.  
  3. namespace _15min_Time
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int hours = int.Parse(Console.ReadLine());
  10.             int minutes = int.Parse(Console.ReadLine());
  11.  
  12.  
  13.             if (minutes > 59)
  14.             {
  15.                 hours = hours + 1;
  16.                 minutes = minutes - 60;
  17.             }
  18.             else if (minutes > 45)
  19.             {
  20.                 hours = hours + 1;
  21.                 minutes = minutes - 60;
  22.             }
  23.             else
  24.             {
  25.                 minutes = minutes + 15;
  26.             }
  27.             if (hours > 23)
  28.             {
  29.                 hours = hours - 24;
  30.             }
  31.             if (minutes < 10)
  32.             {
  33.                 Console.WriteLine(hours + ":" + "0" + minutes);
  34.             }
  35.             else
  36.             {
  37.                 Console.WriteLine(hours + ":" + minutes);
  38.             }
  39.  
  40.         }
  41.     }
  42. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top