java 双色球彩票生成器 Random实现

package p168_6;
import java.sql.Array;
import java.util.Random;
public class Main_test {
	public static void main(String[] args) {
		Random random = new Random();
		boolean charge = false;
		int n = 0,ch = 0;
		int temp[] = new int[6];//
		System.out.print("red:\t");
		while(true){
			charge = false;			
			if(n == 0){
				temp[n] = random.nextInt(32) + 1;
			}						
			ch = random.nextInt(32) + 1;
			for(int i=0;i

运行效果如下:

red:        28    26    13    30    12    9    blue:    15

你可能感兴趣的:(JAVA)