Advertisement
Guest User

Untitled

a guest
Feb 8th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. public static int[] mass() {
  2. Random rnd = new Random();
  3.  
  4. int first = rnd.nextInt(10) + 1;
  5. int second = rnd.nextInt(10) + 1;
  6.  
  7. int[] mass1 = new int[10];
  8. int[] mass2 = new int[10];
  9.  
  10. for (int i = 0; i < mass1.length; i++) {
  11. while (checkValue(first, second)) {
  12. first = rnd.nextInt(10) + 1;
  13. second = rnd.nextInt(10) + 1;
  14. }
  15. mass1[i] = first;
  16. mass2[i] = second;
  17. }
  18.  
  19. return mass1;
  20. }
  21.  
  22. public static boolean checkValue(int first, int second){
  23. boolean check = false;
  24.  
  25. if (first%second == 0){
  26. check = true;
  27. }
  28.  
  29. return check;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement