Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Actual_Mid_Exam;
- import java.util.Scanner;
- public class Task3 {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int firstEmployerPpl = Integer.parseInt(scanner.nextLine());
- int secondEmployerPpl = Integer.parseInt(scanner.nextLine());
- int thirdEmployerPpl = Integer.parseInt(scanner.nextLine());
- int totalPatients = Integer.parseInt(scanner.nextLine());
- int totalEmployersForHour = firstEmployerPpl + secondEmployerPpl + thirdEmployerPpl;
- int hrs = 0;
- while (totalPatients > 0) {
- hrs++;
- if (hrs % 4 != 0) {
- totalPatients -= totalEmployersForHour;
- }
- }
- System.out.println("Time needed: " + hrs + "h.");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement