hi everyone her I have a problem for you and actully my problem and I wanna share it with everyone here oky
The problem haw to generate a list of integers from x to y e.g. 1-100 and it is generated in an increasing order e.g. 1,6,23,25,29,34,........ 98 and actually this is the real problem
the needed number of integers is 20
The Q is how to do that by coding and is there a method in java that handel this issu ?
================
oky have a look what i done so far
java code:
mport java.util.*;
public class mainclass{
public static void main(String [] args ){
Random rand = new Random();
int x =1;
int curr =0;
for(int t =0;t<10;t++){
while(x100){
x = rand.nextInt() % 100;
}
curr =x ;
System.out.println(x) ;
}
}}
any idea :)
2006-10-15
18:25:20
·
2 answers
·
asked by
max hit
1
in
Computers & Internet
➔ Programming & Design
they must be generated in order without sorting them at the end
2006-10-15
19:35:57 ·
update #1