Guest User

Untitled

a guest
Feb 18th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. 'Rextester.Program.Main is the entry point for your code. Don't change it.
  2. 'Compiler version 11.0.50709.17929 for Microsoft (R) .NET Framework 4.5
  3.  
  4. Imports System
  5. Imports System.Collections.Generic
  6. Imports System.Linq
  7. Imports System.Text.RegularExpressions
  8.  
  9. Namespace Rextester
  10. Public Module Program
  11. Public Sub Main(args() As string)
  12. 'Your code goes here
  13. Console.WriteLine("Hello, world!")
  14. Dim matrix = New Integer(3, 2) {{1, 2, 3}, {2, 3, 4}, {3, 4, 5}, {4, 5, 6}}
  15. Dim newMatrix(2, 3) As Integer
  16.  
  17. Dim i As Integer
  18. Dim j As Integer
  19.  
  20. For i = matrix.GetLowerBound(0) To matrix.GetUpperBound(0)
  21. 'Console.WriteLine("row {0}", i)
  22.  
  23. For j = matrix.GetLowerBound(1) To matrix.GetUpperBound(1)
  24. Console.Write(matrix.GetValue(i, j))
  25. newMatrix.SetValue(matrix.GetValue(i, j), j, i)
  26. Next j
  27.  
  28. Console.WriteLine("")
  29. Next i
  30.  
  31. Console.WriteLine("")
  32.  
  33. For i = newMatrix.GetLowerBound(0) To newMatrix.GetUpperBound(0)
  34. 'Console.WriteLine("row {0}", i)
  35.  
  36. For j = newMatrix.GetLowerBound(1) To newMatrix.GetUpperBound(1)
  37. Console.Write(newMatrix.GetValue(i, j))
  38. Next j
  39.  
  40. Console.WriteLine("")
  41. Next i
  42. End Sub
  43. End Module
  44. End Namespace
Add Comment
Please, Sign In to add comment