Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static int[] mass() {
- Random rnd = new Random();
- int first = rnd.nextInt(10) + 1;
- int second = rnd.nextInt(10) + 1;
- int[] mass1 = new int[10];
- int[] mass2 = new int[10];
- for (int i = 0; i < mass1.length; i++) {
- while (checkValue(first, second)) {
- first = rnd.nextInt(10) + 1;
- second = rnd.nextInt(10) + 1;
- }
- mass1[i] = first;
- mass2[i] = second;
- }
- return mass1;
- }
- public static boolean checkValue(int first, int second){
- boolean check = false;
- if (first%second == 0){
- check = true;
- }
- return check;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement