-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathF03Elevator.java
More file actions
26 lines (22 loc) · 787 Bytes
/
F03Elevator.java
File metadata and controls
26 lines (22 loc) · 787 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package DataTypesandVariables;
import java.util.Scanner;
public class F03Elevator {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int numberOfPeople = Integer.parseInt(scanner.nextLine());
int capacity = Integer.parseInt(scanner.nextLine());
// int courses = numberOfPeople / 3;
// int courses1 = numberOfPeople % 3;
// int all = 1 + courses;
int courses = 0;
if (numberOfPeople <= capacity){
courses = 1;
} else if (numberOfPeople % capacity == 0) {
courses = numberOfPeople / capacity;
} else {
courses = (numberOfPeople / capacity) + 1;
}
//int courses = (int) Ma
System.out.println(courses);
}
}