x09818
|
分享:
▲
会有你想要的结果~ Public Class Form1 Dim a(100) As Integer Dim b(9) As Integer Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Label1.Text = "100组乱数:" & vbCrLf For i As Integer = 1 To 100 a(i) = Int(Rnd(10) * 10) If i = 1 Then Label1.Text &= a(i) Else Label1.Text &= ", " & a(i) End If Next End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click For i = 0 To 9 b(i) = 0 Next For i = 1 To 100 b(a(i)) += 1 Next Label2.Text = "统计结果:" & vbCrLf For i = 0 To 9 Label2.Text &= "数字为" & i & "的数量是" & b(i) & vbCrLf Next End Sub End Class
本帖包含附件 |
|
x09818.rar
(2022-06-09 14:13 / 9 KB) 说明: 执行档 |
下载次数: | 13 |
[ 此文章被x09818在2009-12-11 12:26重新编辑 ]
此文章被评分,最近评分记录财富:50 (by 三仙) | 理由: ^^ 因为您的参与,让程式设计更容易!! | |
|
|
|