krasi1105

15 minutes

Mar 7th, 2017
274
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.00 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 ConsoleApplication9
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int hour= int.Parse(Console.ReadLine());
  14.             int min= int.Parse(Console.ReadLine());
  15.            
  16.            
  17.  
  18.            
  19.             min = min + 15;
  20.           if( min >= 60)
  21.             {
  22.                 min -= 60;
  23.                 hour++;
  24.             }
  25.           if( hour >=24)
  26.             {
  27.                 hour -= 24;
  28.             }
  29.           //if( hour > 23 && min > 59)
  30.            // {
  31.           //      hour = 0;
  32.           //  }
  33.          
  34.             if(min < 10)
  35.             {
  36.                 Console.WriteLine("{0}:0{1}",hour,min);
  37.             }
  38.             else
  39.             {
  40.                 Console.WriteLine("{0}:{1}",hour,min);
  41.             }
  42.            
  43.            
  44.  
  45.            
  46.                
  47.            
  48.         }
  49.     }
  50. }
Add Comment
Please, Sign In to add comment