fbinnzhivko

Фирма

Aug 28th, 2016
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.61 KB | None | 0 0
  1. using System;
  2. class Program
  3. {
  4.     static void Main()
  5.     {
  6.         int hours = int.Parse(Console.ReadLine());
  7.         int days = int.Parse(Console.ReadLine());
  8.         int employer = int.Parse(Console.ReadLine());
  9.  
  10.         var realHours = (0.90 * days) * 8;
  11.         var extraHours = employer * (2 * days);
  12.  
  13.         var total = Math.Floor(realHours + extraHours);
  14.  
  15.         if (total >= hours)
  16.         {
  17.             Console.WriteLine("Yes!{0} hours left.", total - hours);
  18.         }
  19.         else
  20.         {
  21.             Console.WriteLine("Not enough time!{0} hours needed.", hours - total);
  22.         }
  23.     }
  24. }
Add Comment
Please, Sign In to add comment