Arrays 在visual basic控制台中将二维数组显示为行和列
我试图将下面的二维数组显示为行和列Arrays 在visual basic控制台中将二维数组显示为行和列,arrays,vb.net,Arrays,Vb.net,我试图将下面的二维数组显示为行和列 Module Module1 Sub Main() 'declaring and initializing a 2d array Dim a1(,) As Integer = {{2, 3}, {5, 3}} For Each ele As Integer In a1 Console.WriteLine(ele) Next End Sub
Module Module1
Sub Main()
'declaring and initializing a 2d array
Dim a1(,) As Integer = {{2, 3}, {5, 3}}
For Each ele As Integer In a1
Console.WriteLine(ele)
Next
End Sub
End Module
我需要输出如下所示:
2 5
3 3
我需要你们的帮助。请分别在每个维度上循环:
For I as Integer = 0 to a1.GetUpperBound(0)
For J as Integer = 0 to a1.GetUpperBound(1)
Console.Write("{0} ", a1(j,i))
Next
console.WriteLine()
Next
演示:是否可能重复?