双色球选号器的java实现
来源:互联网 发布:vf数据库视频教程网易 编辑:程序博客网 时间:2024/04/30 07:29
package com.byp;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
public class SelectNum {
private int lottery[];
private Map<Integer, String> map = new HashMap<Integer, String>();
public int[] getLottery() {
return lottery;
}
public void setLottery(int[] lottery) {
this.lottery = lottery;
}
public void run(){
lottery = new int[6];
for (int i = 0; i < lottery.length; i++) {
int x = (int)(Math.random()*32+1);
if (map.size()==0) {
map.put(x, "√");
lottery[i] = x;
}else{
x = this.compareMap(x);
map.put(x, "√");
}
lottery[i] = x;
}
}
public int compareMap(int x){
if (map.get(x)!=null) {
x = (int)(Math.random()*32+1);
this.compareMap(x);
}
return x;
}
public static void main(String[] args) {
SelectNum t = new SelectNum();
t.run();
int caipiao[] = t.getLottery();
Arrays.sort(caipiao);
for (int i = 0; i < caipiao.length; i++) {
System.out.print(caipiao[i]+" ");
}
System.out.print((int)(Math.random()*15+1));
}
}
- 双色球选号器的java实现
- C#--实例选号器/实现单组选号和手写选号、展示所有选号功能
- billionaire双色球选号器
- 用Java做的模拟“双色球”机选号码
- VC++ 多线程实现双色球投注选号程序
- 封装一个双色球选号码的方法
- 双色球彩票选号器vs c++
- Java 简单多线程选号
- Java 简单多线程选号
- C#--实例选号器--实现删除和清空
- c#--实例选号器--实现打印、序列化方式保存
- 双色球选号方法
- 周末无聊写的一个C语言双色球选号程序
- 带感应系统的彩票选号器(详解)
- 【Java多线程编程】选号程序
- 关于七星彩选号的问题
- Android——手机彩票摇晃选号(双色球) 实现原理
- 正确率88%、java Swing开发的彩票(排列三)智能选号系统问世
- 【C语言点滴】20101124期 char* p 与 char p[] 区别
- Apache2 httpd.conf配置文件中文版详解
- java 递归的实习
- 跨浏览器兼容测试8大利器
- 多个ftp登陆用户权限不同
- 双色球选号器的java实现
- linux man 手册各个章节的意义和用法
- jxl导出图片到excel
- SQL Server 索引结构及其使用(三)
- jsp程序设计:JDOM操作xml
- 存储过程分页
- CA卡
- openflashchart使用
- checkbox全选