Advertisement
yanchevilian

01. National Court

Apr 1st, 2021
376
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.97 KB | None | 0 0
  1. using System;
  2.  
  3. namespace National_Court
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int employees = 3;
  10.             double allEmployeeEfficientlyPerHour = 0;
  11.             int timeNeeededToAnswerAllPeople = 0;
  12.  
  13.             for (int i = 0; i < employees; i++)
  14.             {
  15.                 double eachEmployeeEfficientlyPerHour = double.Parse(Console.ReadLine());
  16.                 allEmployeeEfficientlyPerHour += eachEmployeeEfficientlyPerHour;
  17.             }
  18.             double peopleCount = double.Parse(Console.ReadLine());
  19.  
  20.             while (peopleCount > 0)
  21.             {
  22.                 timeNeeededToAnswerAllPeople++;
  23.                 if (timeNeeededToAnswerAllPeople % 4 == 0)
  24.                 {
  25.                     continue;
  26.                 }
  27.                 peopleCount -= allEmployeeEfficientlyPerHour;
  28.             }
  29.             Console.WriteLine($"Time needed: {timeNeeededToAnswerAllPeople}h.");
  30.         }
  31.     }
  32. }
  33.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement