I have to generate randoms numbers, i have a code running and working, but it doesnt seems random, it generates sequences, is right anyway? or is there another way to do this
public static void main(String[] args) {
Scanner teclado = new Scanner(System.in);
System.out.println("Ingrese el numero N");
int n = teclado.nextInt();
for (int i = 1; i <= n; i++){
double d = numerosAleatorios(i,n);
System.out.println(d);
}
}
public static double numerosAleatorios(double b, double c){
return b / c;
}
Aucun commentaire:
Enregistrer un commentaire