36抽8 模拟抽奖
package com.zuoye.test; import java.lang.reflect.Array; import java.util.Random; public class Choujiang { public static void main(String[] args) { int[] array=new int[8]; Random a=new Random(); for(int i=0;i<8;i++) { //System.out.println(a.nextInt(36)); array[i]=a.nextInt(36); for(int j=0;j<i;j++) { if(array[j]==array[i]) { i=i-1; } } } System.out.println(array[0]+" "+array[1]+" "+array[2]+" "+array[3]+" "+array[4]+" "+array[5]+" "+array[6]+" "+array[7]); } }