最近买了2次彩票,都是让投注站给我随机一张。可惜的是第2次随机的号码一个都没对上。自己搞个随机的程序玩吧,以后就照这个程序,一次随机一个号码,来买。 import java.util.Random; /** * 用于生成双色球彩票号码的程序 * * @author tommy * */ public class LotteryGuess { // 喜欢的蓝色球号码,如果这里不指定为"-1"以外的其它值,将会随机为蓝球赋值 private static int loveRedNumber = 6; // 讨厌的红色球号码,这里的红色球号码将不会出现在所选的号码中 private static int[] hateRedNumbers = new int[] {}; // 想要得到的号码组数,默认就选一组号码,咱穷 private static int total = 1; public static void main(String[] args) { for (int i = 0; i < total; i++) { int blueNumber = getBlueNumber(); int[] red = getRedNumbers(); System.out.println(red[0] + " " + red[1] + " " + red[2] + " " + red[3] + " " + red[4] + " " + red[5] + " + " + blueNu