精 彩 论 坛已经更名为百强频道,迁新地址www.bqpd.cn

亲爱的朋友,首先为给您带来的不便深表歉意,现因发展的需要,精彩论坛迁到新的地址http://www.bqpd.cn,还望您一如既往地支持精彩论坛,谢谢
精 彩 论 坛已经更名为百强频道,迁新地址www.bqpd.cn

论坛因发展的需要现已经迁址www.bqpd.cn,等待您的到来。谢谢


    目前就写个基号冷热序号

    分享
    avatar
    一品明灯
    Admin

    帖子数 : 292
    积分 : 720
    威望 : 4
    注册日期 : 10-03-02
    年龄 : 8

    普通 目前就写个基号冷热序号

    帖子 由 一品明灯 于 2010-03-11, 14:49

    目前就写个基号冷热序号

    '==========================================================
    ' 基号冷热序号(chinamen668)
    '==========================================================
    CpParam.Add "开奖号码","不排序","{不排序}{排序}{不含末尾号}"'
    Function Main
    '===============申明或定义变量=============
    CpRowCount = CpData.RowCount '开奖期数
    CpColCount = CpData.ColCount '开奖号码个数
    CpMaxCode = CpData.MaxCode '最大号码
    CpMinCode = CpData.MinCode '最小号码
    CpCodeCount = CpData.CodeCount '号码数量

    '先定义是否按大小来排序基号
    ub_*** = CpParam.Value("开奖号码")
    Redim Hm(CpRowCount,CpCodeCount)
    if Pub_***="不含末尾号" then Bhmwh=1
    For row = 0 to CpRowCount - 1
    For Col=0 to CpColCount-1
    Hm(row,Col)=CpData.Code(Row,Col)
    Next

    If Pub_***<>"不排序" then '大小排序号码
    For i=0 to CpColCount-2
    For j=i+1 to CpColCount-1-Bhmwh
    if Hm(row,i)>Hm(row,j) then
    k=Hm(row,i)
    Hm(row,i)=Hm(row,j)
    HM(row,j)=k
    end if
    Next
    Next
    End If
    Next
    '=================建表=================
    CpAna.AddField "序号", 4
    For i = 1 to CpColCount
    CpAna.AddField "号 次"&i,8
    Next
    CpAna.RowCount = CpCodeCount
    CpAna.CreateTable()

    '==============算法主体============================
    ReDim sum(CpCodeCount)
    ReDim Sortcodes(CpCodeCount)

    For i = CpMinCode to CpMaxCode
    CpAna.Cell(i-CpMinCode,0) =i
    Next

    For col = 0 to CpColCount - 1

    For i = 0 to CpCodeCount - 1
    sum(i)=0
    Next
    For row = 0 to CpRowCount - 1
    sum( Hm(row,Col)-CpMinCode) = sum( Hm(row,Col)-CpMinCode) + 1
    Next
    Sort sum,SortCodes
    For i = CpMinCode to CpMaxCode
    hc=SortCodes( i-CpMinCode)
    CpAna.Cell(i-CpMinCode,1+col) =hc&"-"&sum(hc-CpMinCode)
    Next

    Next

    End Function
    '==============辅助函数============================
    '根据开奖次数排序号码,Num为排序好的号码序列
    '出现次数多的在前进行排序,则次数相同时,大号码在前
    Function Sort(ByVal Sum(), ByRef Num())
    CpMaxCode = CpData.MaxCode
    CpMinCode = CpData.MinCode
    CpCodeCount = CpData.CodeCount'号码个数
    ReDim aa(CpCodeCount)
    For i = 0 to CpCodeCount-1
    n =-1
    max =-1
    For j = CpCodeCount-1 to 0 step -1
    If aa(j) <> -1 And Sum(j) > max Then
    max = Sum(j)
    n = j
    End If
    Next
    Num(i) = CpMinCode+n
    aa(n) =-1
    Next

    End Function




    [本帖已被作者于2010年2月18日19时19分48秒编辑过]


    _________________
    一流的条件 精彩的论坛

      目前的日期/时间是2018-04-25, 01:58