以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  如何设计统计报表  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=105860)

--  作者:zm9669
--  发布时间:2017/8/28 10:33:00
--  如何设计统计报表
0,1,2,3,4,5,6,7,8,9这十个数字,每次随机出五个,统计每个数字的出现次数
--  作者:有点甜
--  发布时间:2017/8/28 10:37:00
--  
Dim ary() As String = {0,1,2,3,4,5,6,7,8,9}
Dim dic As new Dictionary(Of String, Integer)
For Each s As String In ary
    dic.add(s, 0)
Next
For i As Integer = 1 To 5
    Dim s As String = ary(rand.Next(ary.length))
    dic(s) += 1
Next
For Each s As String In ary
    output.show(s & ":" & dic(s))
Next