rado8506

05. Firm

Jan 19th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.94 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 ConsoleApp1
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int totalhours = int.Parse(Console.ReadLine());
  14.             int days = int.Parse(Console.ReadLine());
  15.             int people = int.Parse(Console.ReadLine());
  16.             double peopleDay = days * 0.90;
  17.             double peopleHour = (10 * peopleDay) * people;
  18.             double leftHours = peopleHour - totalhours;
  19.             double notleft = totalhours - peopleHour;
  20.             if (totalhours <= peopleHour)
  21.             {
  22.                 Console.WriteLine("Yes!{0} hours left.", Math.Floor(leftHours));
  23.             }
  24.             else if (totalhours > peopleHour)
  25.             {
  26.                 Console.WriteLine("Not enough time!{0} hours needed.", Math.Floor(notleft));
  27.             }
  28.         }
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment