日期:2014-05-20  浏览次数:20754 次

JAVA彩票源程序代码
中了会分你一份   也可化钱买了

------解决方案--------------------
如果能用程序搞定,那人家彩票公司吃什么?
------解决方案--------------------
import java.text.DecimalFormat;
import javax.swing.JOptionPane;
class oopp{
private void getRanDom(int sel ,int min,int max){
int i,j;
double num,num1;
double temp,temp1;
DecimalFormat df =new DecimalFormat( "00 ");//数字格式化不足两位前面加0
H_Show_Header();
for(j=1;j <=sel;j++){
System.out.print( "第 "+ j + "注: "+ "\t ");
for (i=0;i <7;i++){//一共产生7位随机数
//temp获取前6位数的值,temp1获取最后一位的值
temp=Math.random() * (max-min+1);
temp1=Math.random() * (16-1+1);
//num=floor(temp),num1=floor(temp1)
num=Math.floor(temp)+min;
num1=Math.floor(temp1)+min;
if(i==6){//打印到第6位加*号再打印第7位
System.out.print( "* " + df.format(num1) + " ");
}
else{
System.out.print( " "+df.format(num) + " ");
}

}
System.out.println( "\n ");
}
H_Money(sel);
}
public static void main(String[] args){
int selnum;
String tempstr;
oopp Jop = new oopp();
tempstr=JOptionPane.showInputDialog(null, "请输入要买几注? ");
selnum=Integer.parseInt(tempstr);
Jop.getRanDom(selnum,1,23);
}
private void H_Money(int money){//foot
System.out.println( "-------------------------------------------------- ");
System.out.println( "\t\t "+ "多谢惠顾,总共购买: "+money+ "注 ");
System.out.println( "\t\t "+ "您一共花费了: "+ money*2 + "元 ");
System.out.println( "-------------------------------------------------- ");
}
private void H_Show_Header(){//head
System.out.println( "-------------------------------------------------- ");
System.out.println( "/////////////欢迎使用双色球自动选号系统/////////// ");
System.out.println( "-------------------------------------------------- ");
}
}
------解决方案--------------------
历史数据分析的功能都没有,基本上没用