Wypełnij tablicę losowymi liczbami między 1 a 100 Java
import java.util.Scanner;
import java.util.Arrays;
public class RndArray{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
int arrLength;
System.out.println("Enter your array's length");
arrLength = scan.nextInt();
int [] arr = new int [arrLength]; // between [] array's length
for(int i = 0 ; i<arrLength ; i++){
arr[i] = (int) (Math.random()*100 + 1);
}
System.out.println(Arrays.toString(arr));
}
}
Steven2003