//Java
class Main {
public static void main(String[] args){
int[] a = new int[new java.util.Random().nextInt(10)];
int b = 1;
for (int i = 0; i < a.length; i++) {
a[i] = new java.util.Random().nextInt(9) + 1;
System.out.print(a[i] + " ");
b *= a[i];
}
System.out.print("\nmulti: " + b);
}
}
Проверка:
$ java Main.java
2 7 4
multi: 56