desislava_topuzakova

03. Elevator

May 29th, 2021
1,192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.44 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 people = Integer.parseInt(scanner.nextLine());
  7.         int capacity = Integer.parseInt(scanner.nextLine());
  8.  
  9.         //people / capacity = double -> Math.ceil -> print
  10.         double courses = Math.ceil(people * 1.0 / capacity);
  11.         System.out.printf("%.0f", courses);
  12.  
  13.     }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment