Advertisement
silvana1303

national court

Jun 12th, 2020
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.80 KB | None | 0 0
  1. using System;
  2.  
  3. namespace mid_exam
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int reception1 = int.Parse(Console.ReadLine());
  10.             int reception2 = int.Parse(Console.ReadLine());
  11.             int reception3 = int.Parse(Console.ReadLine());
  12.             int peopleCount = int.Parse(Console.ReadLine());
  13.  
  14.             int countHour = 0;
  15.  
  16.             while (peopleCount > 0)
  17.             {
  18.                 int peoplePerHour = reception1 + reception2 + reception3;
  19.  
  20.                 peopleCount -= peoplePerHour;
  21.                 countHour++;
  22.  
  23.                 if (countHour % 4 == 0)
  24.                 {
  25.                     countHour++;
  26.                 }
  27.  
  28.             }
  29.  
  30.             Console.WriteLine($"Time needed: {countHour}h.");
  31.         }
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement