Advertisement
Pavkata7000

Untitled

Oct 1st, 2020 (edited)
498
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class scratch {
  3.  
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6. int[] arrayInt = new int[5];
  7. for (int i=0;i < 5;i++){
  8. arrayInt[i] = Integer.parseInt(scanner.nextLine());
  9. }
  10.  
  11. int result = 0;
  12. int counter = 0;
  13. while (counter < 3){
  14. result++;
  15. if (result % arrayInt[0] == 0){
  16. counter++;
  17. }
  18. if (result % arrayInt[1] == 0){
  19. counter++;
  20. }
  21. if (result % arrayInt[2] == 0){
  22. counter++;
  23. }
  24. if (result % arrayInt[3] == 0){
  25. counter++;
  26. }
  27. if (result % arrayInt[4] == 0){
  28. counter++;
  29. }
  30.  
  31.  
  32. if (counter < 3){
  33. counter = 0;
  34. }
  35. }
  36. System.out.println(result);
  37. }
  38. }
  39.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement