import java.util.ArrayList;
import java.util.Arrays;
import java.util.Random;
public class Main {
static Random r = new Random();
public static void main(String[] args) {
System.out.println("---------500W 我来啦和帆----------");
int 注数 = 10000 ;
for (int n = 0; n < 注数; n++) {
摇奖();
}
System.out.println("---------500W 我来啦----------");
}
public static void 摇奖(){
//红球是1-32 篮球是1-16
ArrayList
ArrayList
int[] redBalls = new int[6];
for (int j = 0; j < 32; j++)
list1.add(j + 1);
for (int i = 0; i < 16; i++)
list2.add(i + 1);
// 红球
System.out.print("红散旦球:");
for (int k = 0; k < 6; k++) {
int indexRed = r.nextInt(list1.size());
redBalls[k]=list1.get(indexRed);
list1.remove(indexRed);
}
Arrays.sort(redBalls);//排序后打出红球
for(int s = 0 ; s < redBalls.length ; s++){
System.out.print(getRedBall(redBalls[s]) + " ");
}
int indexBlue = r.nextInt(list2.size());
System.out.println("蓝球:" + getRedBall(list2.get(indexBlue))+"");
}
public static String getRedBall(Integer a){
String b = "";
if (a<10) b = "0"+a+"";
else b = a.toString();
return b;
}
}