Advertisement
VelizarAvramov

04. Elevator

Nov 14th, 2019
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.69 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _04._Elevator
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             //int persons = int.Parse(Console.ReadLine());
  10.             //int capacity = int.Parse(Console.ReadLine());
  11.  
  12.             //int courses = (int)Math.Ceiling((double)persons / capacity);
  13.  
  14.             //Console.WriteLine($"{courses}");
  15.  
  16.             int persons = int.Parse(Console.ReadLine());
  17.             int capacity = int.Parse(Console.ReadLine());
  18.  
  19.             int courses = persons / capacity;
  20.  
  21.             if (persons % capacity != 0)
  22.             {
  23.                 courses++;
  24.             }
  25.             Console.WriteLine($"{courses}");
  26.         }
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement