Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class scratch {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int[] arrayInt = new int[5];
- for (int i=0;i < 5;i++){
- arrayInt[i] = Integer.parseInt(scanner.nextLine());
- }
- int result = 0;
- int counter = 0;
- while (counter < 3){
- result++;
- if (result % arrayInt[0] == 0){
- counter++;
- }
- if (result % arrayInt[1] == 0){
- counter++;
- }
- if (result % arrayInt[2] == 0){
- counter++;
- }
- if (result % arrayInt[3] == 0){
- counter++;
- }
- if (result % arrayInt[4] == 0){
- counter++;
- }
- if (counter < 3){
- counter = 0;
- }
- }
- System.out.println(result);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement