Java - student (Urgente)

 
Vista:

student (Urgente)

Publicado por andre (4 intervenciones) el 28/04/2006 14:36:36
Auxilio!!!!!!

!!!!!!!!!!!!Por favor es urgente para hoy en la tarde.!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

En base a este vector de 15 pos, con numeros en c/u. tengo que sacarle otro vector de 3 elementos
procedentes del primer vector. y valores aleatorios, que no se repitan y ordenados en nforma ascendente.

POR FAVOR NECESITO AYUDA ASAP

import java.util.Random;
class x {
public static void main (String args[]){

int x[] = new int[15];
intY[] = new int[3];

x[0] = 40;
x[1] = 39;
x[2] = 38;
x[3] = 37;
x[4] = 36;
x[5] = 35;
x[6] = 34;
x[7] = 33;
x[8] = 32;
x[9] = 31;
x[10] =30;
x[11] =29;
x[12] =28;
x[13] =27;
x[14] =26;


min = max = x[0];
Random rnd = new Random();
for(int i = 1; i < 15; i++) {
System.out.println( (int) (rnd.nextDouble() * 15) );

}



}
}
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder