In Java, generate 10 groups randomly 6 digit code
CodePudding user response:
The Random rand=new Random ();
for(int i=0; i<10; I++) {
System. The out. Print (rand. NextInt (1000000) + "");
}
Oh remember junction post
CodePudding user response:
Like this?
int [] arr=new int [10].
Int res=0;
for (int i=0; I & lt; Arr. Length; I++)
{
Res=100000 + (int) (Math. The random () * 900000);
Arr [I]=res;
}
CodePudding user response: