VB,从二维数组a中取出其第一行(i=1),如何把这取出的新数组赋给一维数组
2017-05-15
展开全部
试下这个,只需改动 b(i)=a(i\10+1,i mod 10)换成b(i) = a((i - 1) \ 10 + 1, (i - 1) Mod 10 + 1)
如下:
Private Sub form_click()
Dim a(1 To 10, 1 To 10) As String, b(1 To 100) As String
For i = 1 To 10
For j = 1 To 10
a(i, j) = i * j
Next j
Next i
For i = 1 To 100
b(i) = a((i - 1) \ 10 + 1, (i - 1) Mod 10 + 1)
Print b(i);
Next i
End Sub
如下:
Private Sub form_click()
Dim a(1 To 10, 1 To 10) As String, b(1 To 100) As String
For i = 1 To 10
For j = 1 To 10
a(i, j) = i * j
Next j
Next i
For i = 1 To 100
b(i) = a((i - 1) \ 10 + 1, (i - 1) Mod 10 + 1)
Print b(i);
Next i
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询