Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _04._Elevator
- {
- class Elevator
- {
- static void Main(string[] args)
- {
- //Calculate how many courses will be needed to elevate n persons by using an elevator of capacity of p persons. The input
- //holds two lines: the number of people n and the capacity p of the elevator.
- int persons = int.Parse(Console.ReadLine());
- int capacity = int.Parse(Console.ReadLine());
- int courses = (int)Math.Ceiling((double)persons / capacity);
- Console.WriteLine(courses);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment