Didart

Elevator

Sep 24th, 2021
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.48 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.  
  7.         int countPeople = Integer.parseInt(scanner.nextLine());
  8.         int capacity = Integer.parseInt(scanner.nextLine());
  9.         // kursovete = horata / kapaciteta -> poluchava se drobno chislo -> zakruglqme go
  10.  
  11.         double courses = Math.ceil(countPeople * 1.0 / capacity);
  12.         System.out.printf("%.0f", courses);
  13.     }
  14. }
  15.  
Advertisement
Add Comment
Please, Sign In to add comment