desislava_topuzakova

03. Elevator

Sep 24th, 2021
818
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package Test;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Elevator_03 {
  6.     public static void main(String[] args) {
  7.         Scanner scanner = new Scanner(System.in);
  8.         int countPeople = Integer.parseInt(scanner.nextLine());
  9.         int capacity = Integer.parseInt(scanner.nextLine());
  10.  
  11.         //курсове = хората / капацитета -> дробно число -> нагоре -> отпечатвам
  12.         double courses = Math.ceil(countPeople * 1.0 / capacity);
  13.         System.out.printf("%.0f", courses);
  14.  
  15.     }
  16. }
  17.  
RAW Paste Data