Didart

Elevator

May 20th, 2021
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.57 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Elevator {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.         int numberOfPeople = Integer.parseInt(scanner.nextLine());
  7.         int capacityOfElevator = Integer.parseInt(scanner.nextLine());
  8.  
  9.         // int fullCourses = (int)Math.ceil((double)numberOfPeople / capacityOfElevator);
  10.         int courses = (int)Math.ceil((double)numberOfPeople / capacityOfElevator);
  11.         int fullCourses = courses % numberOfPeople;
  12.        
  13.         System.out.println(fullCourses);
  14.     }
  15. }
  16.  
Advertisement
Add Comment
Please, Sign In to add comment