Skip to content

Instantly share code, notes, and snippets.

@hpneo
Created February 6, 2018 05:04
Show Gist options
  • Save hpneo/d2c71789cacd640fb814b0ce9b8ccd11 to your computer and use it in GitHub Desktop.
Save hpneo/d2c71789cacd640fb814b0ce9b8ccd11 to your computer and use it in GitHub Desktop.
'Rextester.Program.Main is the entry point for your code. Don't change it.
'Compiler version 11.0.50709.17929 for Microsoft (R) .NET Framework 4.5
Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Text.RegularExpressions
Namespace Rextester
Public Module Program
Public Sub Main(args() As string)
'Your code goes here
Console.WriteLine("Hello, world!")
Dim matrix = New Integer(3, 2) {{1, 2, 3}, {2, 3, 4}, {3, 4, 5}, {4, 5, 6}}
Dim newMatrix(2, 3) As Integer
Dim i As Integer
Dim j As Integer
For i = matrix.GetLowerBound(0) To matrix.GetUpperBound(0)
'Console.WriteLine("row {0}", i)
For j = matrix.GetLowerBound(1) To matrix.GetUpperBound(1)
Console.Write(matrix.GetValue(i, j))
newMatrix.SetValue(matrix.GetValue(i, j), j, i)
Next j
Console.WriteLine("")
Next i
Console.WriteLine("")
For i = newMatrix.GetLowerBound(0) To newMatrix.GetUpperBound(0)
'Console.WriteLine("row {0}", i)
For j = newMatrix.GetLowerBound(1) To newMatrix.GetUpperBound(1)
Console.Write(newMatrix.GetValue(i, j))
Next j
Console.WriteLine("")
Next i
End Sub
End Module
End Namespace
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment