public class RandomUtils {
public static void daLeTou(Integer rows) {
muchMonry(36,5,13,2,rows);
}
public static void shuangSeQiu(Integer rows){
muchMonry(34,6,17,1,rows);
}
private static void muchMonry(Integer firstEnd,Integer firstRandNum,Integer secondEnd,Integer secondRandNum,Integer rows){
Random ran = new Random();
for(int i = 0; i < rows; i++) {
ran.ints(1, firstEnd).distinct().limit(firstRandNum).sorted().mapToObj(s -> String.format("%02d", s)).forEach(s -> {
System.out.print(s + "\t");
});
System.out.print("+\t");
ran.ints(1, secondEnd).distinct().limit(secondRandNum).sorted().mapToObj(s -> String.format("%02d", s)).forEach(s -> {
System.out.print(s + "\t");
});
System.out.println("");
}
}
}
大乐透、双色球随机数生成
最新推荐文章于 2023-04-20 17:22:58 发布