网站建设资讯

NEWS

网站建设资讯

vb.net数组题目,vb第五章数组测试题答案

vb.net 从数组{5,7,11,13,17,19}中取一个数,取三次(可以是相同的数),三次之和有几个值?求代码!

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种不同的和值。

VB.NET 二维数组问题

根据你的语句,上下标是确定的,所以定义语句修改为:

Dim ary(UBound(temp), 1) As String '声明二维数组

VB.NET数组问题(!!!!!!!求助!!!!!!!!!)

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


本文标题:vb.net数组题目,vb第五章数组测试题答案
链接地址:http://njwzjz.com/article/phidio.html