Dim a() As Integer
Dim d() As String
Private Sub Command1_Click()
Picture1.Cls '清空picturebox
Dim b, c, i, j As Integer
For i = 0 To 38
If Check1(i).Value = 1 Then
ReDim Preserve a(b)
a(b) = i + 1
b = b + 1
End If
Next
For i = 0 To b - 2
For j = i + 1 To b - 1
Picture1.Print a(i) & Chr(38) & a(j) & " " '输出到picturebox
ReDim Preserve d(c)
d(c) = a(i) & " " & a(j) '保存到数组,待用
c = c + 1
If c Mod 5 = 0 Then '换行,五个一行
Picture1.Print
End If
Next
Next
End Sub
测试可用,附上测试工程
Private Sub 全组合()For i = 1 To 6
For j = i + 1 To 6
For Z = j + 1 To 6
Print i &j &Z
Print i &Z &j
Print j &i &Z
Print j &Z &i
Print Z &i &j
Print Z &j &i
Next
Next
Next
End Sub
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)