您的位置:程序门 -> java -> 非技术区



java彩票源程序代码


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


java彩票源程序代码
发表于:2007-08-14 21:06:33 楼主
中了会分你一份   也可化钱买了
发表于:2007-08-15 00:30:351楼 得分:0
如果能用程序搞定,那人家彩票公司吃什么?
发表于:2007-08-15 00:50:592楼 得分:0
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( "-------------------------------------------------- ");
  }
}
发表于:2007-08-15 16:12:183楼 得分:0
历史数据分析的功能都没有,基本上没用
发表于:2007-09-30 18:47:254楼 得分:0
我们有相同的心亲情,如果可以可交流一下了?我的qq是376553766


快速检索

最新资讯
热门点击