一组数字随机分组?代码
0528260215310625014837413411144939234635441607242733471042381936090829301713320403121...
05 28 26 02 15 31 06 25 01 48
37 41 34 11 14 49 39 23 46 35
44 16 07 24 27 33 47 10 42 38
19 36 09 08 29 30 17 13 32 04
03 12 18 20 21 22 40 43 45 展开
37 41 34 11 14 49 39 23 46 35
44 16 07 24 27 33 47 10 42 38
19 36 09 08 29 30 17 13 32 04
03 12 18 20 21 22 40 43 45 展开
1个回答
展开全部
Dim arr(48) As Integer
Sub 五组()
Dim s As String, R As Integer, T As Integer, j As Integer
j = 0
For i = 48 To 0 Step -1
R = Int(Rnd * (i + 1))
T = arr(R)
arr(R) = arr(i)
arr(i) = T
s = s & Format(T, "00") & " "
j = (j + 1) Mod 10 '取余当第10个的时候余数0
If j = 0 Then s = s & vbCrLf
Next
MsgBox s
End Sub
Private Sub Command1_Click()
数组初始化
五组
End Sub
Sub 数组初始化()
Dim i As Integer
For i = 0 To 48
arr(i) = i + 1
Next
End Sub
Sub 五组()
Dim s As String, R As Integer, T As Integer, j As Integer
j = 0
For i = 48 To 0 Step -1
R = Int(Rnd * (i + 1))
T = arr(R)
arr(R) = arr(i)
arr(i) = T
s = s & Format(T, "00") & " "
j = (j + 1) Mod 10 '取余当第10个的时候余数0
If j = 0 Then s = s & vbCrLf
Next
MsgBox s
End Sub
Private Sub Command1_Click()
数组初始化
五组
End Sub
Sub 数组初始化()
Dim i As Integer
For i = 0 To 48
arr(i) = i + 1
Next
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询