Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package MidExam.O2;
- import java.util.Scanner;
- public class O1SoftUniReception {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int firstEmployee = scanner.nextInt();
- int secondEmployee = scanner.nextInt();
- int thirdEmployee = scanner.nextInt();
- int students = scanner.nextInt();
- int time = 0;
- int sum = firstEmployee + secondEmployee + thirdEmployee;
- while (students > 0) {
- students -= sum;
- time += 1;
- if (time % 4 == 0) {
- time++;
- }
- }
- System.out.printf("Time needed: %dh.", time);
- }
- }
Add Comment
Please, Sign In to add comment