Advertisement
AvengersAssemble

Effective Solution

Sep 10th, 2013
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.02 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 ConsoleApplication1
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             Console.Write("Enter takeoff hour: ");
  14.             int hour = int.Parse(Console.ReadLine());
  15.             Console.Write("Enter takeoff mins: ");
  16.             int min = int.Parse(Console.ReadLine());
  17.             if (hour < 7)
  18.             {
  19.                 if (min != 0)
  20.                     min = 60 - min;
  21.                 if (min == 0)
  22.                     hour--;
  23.                 hour = 6 - hour;
  24.                 //DateTime takeoff = new DateTime(1, 1, 1, hour, min, 1);
  25.                 //Console.WriteLine("Can only take off in " + takeoff.ToString("hh:mm"));
  26.                 Console.WriteLine("Can only take off in " + hour + " hours and " + min + " minutes.");
  27.             }
  28.             else
  29.                 Console.WriteLine("Takeoff is green lighted");
  30.  
  31.         }
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement