Teo_Yanchev

C# Fundamentals - 01. NationalCourt - 29.02.2020 MidExam G2

Oct 29th, 2020
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. using System;
  2.  
  3. namespace MidExam_29._02._2020_G2
  4. {
  5. class NationalCourt
  6. {
  7. static void Main()
  8. {
  9. int employeOne = int.Parse(Console.ReadLine());
  10. int employeTwo = int.Parse(Console.ReadLine());
  11. int employeThree = int.Parse(Console.ReadLine());
  12. int totalPeople = int.Parse(Console.ReadLine());
  13.  
  14. int answerQuestionsPerHour = employeOne + employeTwo + employeThree;
  15. int hours = 0;
  16. while (totalPeople > 0)
  17. {
  18. hours += 1;
  19.  
  20. if (hours % 4 == 0)
  21. {
  22. continue;
  23. }
  24.  
  25. totalPeople -= answerQuestionsPerHour;
  26. }
  27.  
  28. Console.WriteLine($"Time needed: {hours}h.");
  29. }
  30. }
  31. }
  32.  
Advertisement
Add Comment
Please, Sign In to add comment