Untitled
unknown
plain_text
a year ago
673 B
10
Indexable
import java.util.Random;
public class Main {
public static void main(String[] args) {
Random r = new Random();
int num;
int[] numerot;
numerot = new int[7];
for (int i = 0; i < numerot.length; i++) {
do {
num = r.nextInt(34) + 1;
for(int j = 0 ; j < numerot.length ; j++) {
if(num == numerot[j]) {
num = -1;
break;
}
}
} while(num == -1);
numerot[i] = num;
System.out.println(numerot[i]);
}
}
}Editor is loading...
Leave a Comment