StoimenK

2.3. Elevator

Jan 26th, 2020
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.66 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 _2._3.Elevator
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.  
  14.             int peopleNumN = int.Parse(Console.ReadLine());
  15.             int capacityNumP = int.Parse(Console.ReadLine());
  16.  
  17.             int courses = (int)Math.Ceiling((double)peopleNumN / capacityNumP);
  18.  
  19.             if (peopleNumN <= capacityNumP)
  20.             {
  21.                 Console.WriteLine(courses);
  22.             }
  23.             else
  24.             {
  25.                 Console.WriteLine(courses);
  26.             }
  27.  
  28.  
  29.         }
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment