重庆分公司,新征程启航
为企业提供网站建设、域名注册、服务器等服务
Sub 和()
创新互联建站专业为企业提供沙湾网站建设、沙湾做网站、沙湾网站设计、沙湾网站制作等企业网站建设、网页设计与制作、沙湾企业网站模板建站服务,10余年沙湾做网站经验,不只是建网站,更提供有价值的思路和整体网络服务。
Dim Arr, Dic As Object, i, j, k
Set Dic = CreateObject("Scripting.Dictionary")
Arr = Array(5, 7, 11, 13, 17, 19)
For i = 0 To UBound(Arr)
For j = 0 To UBound(Arr)
For k = 0 To UBound(Arr)
Dic(Arr(i) + Arr(j) + Arr(k)) = ""
Next k
Next j
Next i
MsgBox Dic.Count
Set Dic = Nothing
End Sub
结果为22种不同的和值。
根据你的语句,上下标是确定的,所以定义语句修改为:
Dim ary(UBound(temp), 1) As String '声明二维数组
Dim a(3, 3, 3)
Dim b(3, 3), c(3, 3), d(3, 3)
Private Sub aaa()
' 对数组a(3,3,3)赋值
For i = 1 To 3
For j = 1 To 3
b(i, j) = a(1, i, j)
Next
Next
For i = 1 To 3
For j = 1 To 3
c(i, j) = a(2, i, j)
Next
Next
For i = 1 To 3
For j = 1 To 3
d(i, j) = a(3, i, j)
Next
Next
End Sub