Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class SoftUniReception {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int employeesOne = Integer.parseInt(scanner.nextLine());
- int employeesTwo = Integer.parseInt(scanner.nextLine());
- int employeesThree = Integer.parseInt(scanner.nextLine());
- int allStudents = Integer.parseInt(scanner.nextLine());
- int studentsHour = 0;
- int neededTime = employeesOne + employeesTwo + employeesThree;
- while (allStudents > 0) {
- studentsHour++;
- if (studentsHour % 4 == 0) {
- continue;
- }
- allStudents -= neededTime;
- }
- System.out.printf("Time needed: %dh.%n", studentsHour);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement