Produce different random number sequences

xiaoxiao2021-03-05  21

Public String Gtrn Dun (INT C) {

int [] num = new int [c];

Int NumTemp;

Int Re;

Random rnd = new random ();

StringBuffer SB = new stringbuffer ();

For (int i = 0; i

{DO {NumTemp = rND.NextINT (100);

RE = 0;

For (int m = 0; m

{if (Num [M] == NumTemp)

RE ;

} // for

} while (re! = 0);

Num [i] = NUMTEMP;

} // for

For (int i = 0; i

{IF (i == Num.length-1)

Sb.append (NUM [I]);

Else

Sb.append (NUM [i] ",");

} // for

Return sb.toString ();

}

}

转载请注明原文地址:https://www.9cbs.com/read-37798.html

New Post(0)