Advertisement
svephoto

SoftUni Reception [Java]

Aug 4th, 2020 (edited)
622
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.83 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class SoftUniReception {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.  
  7.         int employeesOne = Integer.parseInt(scanner.nextLine());
  8.         int employeesTwo = Integer.parseInt(scanner.nextLine());
  9.         int employeesThree = Integer.parseInt(scanner.nextLine());
  10.  
  11.         int allStudents = Integer.parseInt(scanner.nextLine());
  12.  
  13.         int studentsHour = 0;
  14.  
  15.         int neededTime = employeesOne + employeesTwo + employeesThree;
  16.  
  17.         while (allStudents > 0) {
  18.             studentsHour++;
  19.  
  20.             if (studentsHour % 4 == 0) {                
  21.                 continue;
  22.             }
  23.          
  24.             allStudents -= neededTime;
  25.         }
  26.      
  27.         System.out.printf("Time needed: %dh.%n", studentsHour);
  28.     }
  29. }
  30.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement