Advertisement
Guest User

Untitled

a guest
Aug 15th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.78 KB | None | 0 0
  1. using System;
  2.  
  3. namespace SoftuniRecepcion
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int employee1 = int.Parse(Console.ReadLine());
  10.             int employee2 = int.Parse(Console.ReadLine());
  11.             int employee3 = int.Parse(Console.ReadLine());
  12.             int students = int.Parse(Console.ReadLine());
  13.  
  14.            
  15.             int studentsPerHour = employee1 + employee2 + employee3;
  16.             if (studentsPerHour != 0)
  17.             {
  18.                 double time = Math.Ceiling(students / (studentsPerHour * 1.00));
  19.                 if (time > 3)
  20.                 {
  21.                     time = 4 * time / 3;
  22.                 }
  23.  
  24.                 Console.WriteLine($"Time needed: {(int)time}h.");
  25.             }
  26.         }
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement