SHARE
TWEET

Untitled

a guest Nov 19th, 2019 81 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Imports System
  2.  
  3. Namespace ConsoleApp1
  4.     Public Class Program
  5.         Public Shared Sub Main()
  6.             Dim minNumber, maxNumber As Integer
  7.             Dim matrix As Integer(,) = New Integer(4, 4) {
  8.             {1, 2, 8, 9, 5},
  9.             {4, 6, 7, 3, 5},
  10.             {1, 8, 9, 7, 5},
  11.             {6, 3, 2, 8, 1},
  12.             {4, 7, 9, 3, 2}}
  13.             minNumber = matrix(0, 0)
  14.             maxNumber = matrix(0, 0)
  15.  
  16.             For i As Integer = 0 To matrix.GetLength(0) - 1
  17.  
  18.                 For j As Integer = 0 To matrix.GetLength(1) - 1 - 1
  19.  
  20.                     If matrix(i, j) < minNumber Then
  21.                         minNumber = matrix(i, j)
  22.                     End If
  23.  
  24.                     If matrix(i, j) > maxNumber Then
  25.                         maxNumber = matrix(i, j)
  26.                     End If
  27.                 Next
  28.             Next
  29.  
  30.             Console.WriteLine(minNumber & " " & maxNumber)
  31.         End Sub
  32.     End Class
  33. End Namespace
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top