Visual Basic NET ( 2)

         


. , , . . .

1-

2-

3-

4-



1

-8

-14

-19

-18

2

25

28

26

20

3

11

18

20

25

( ):

1) 2- 4? 3- 1? .

2) 2?

3) 3-

4)

5) , 24-26

:

t(1,1)

t(1,2)

t(1,3)

t(1,4)

t(2,1)

t(2,2)

t(2,3)

t(2,4)

t(3,1)

t(3,2)

t(3,3)

t(3,4)

(), () . .

Integer t. :

Dim t (3, 4) As Integer

, 1 3, 0 3, 0 4. :

t(0,0)

t(0,1)

t(0,2)

t(0,3)

t(0,4)

t(1,0)

t(1,1)

t(1,2)

t(1,3)

t(1,4)

t(2,0)

t(2,1)

t(2,2)

t(2,3)

t(2,4)

t(3,0)

t(3,1)

t(3,2)

t(3,3)

t(3,4)

.

:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click


Dim t(3, 4) As Integer
Dim i, j, s As Integer
' :
t(1, 1) = -8 : t(1, 2) = -14 : t(1, 3) = -19 : t(1, 4) = -18
t(2, 1) = 25 : t(2, 2) = 28 : t(2, 3) = 26 : t(2, 4) = 20
t(3, 1) = 11 : t(3, 2) = 18 : t(3, 3) = 20 : t(3, 4) = 25
' 1 :
Debug.WriteLine(t(2, 4) & " " & t(3, 1))
' (2 ):
Debug.Write(" : ")
For i = 1 To 3 : Debug.Write(t(i, 2) & " ") : Next
Debug.WriteLine("") '
' (3 ):
i = 3
s = 0
For j = 1 To 4 : s = s + t(i, j) : Next
Debug.WriteLine(" " & s / 4)
' (4 ):
For i = 1 To 3
For j = 1 To 4
Debug.Write(t(i, j) & " ")
Next j
Debug.WriteLine("") '
Next i
' 24-26 (5 ):
For i = 1 To 3
For j = 1 To 4
If t(i, j) >= 24 And t(i, j) <= 26 Then Debug.WriteLine(" " & i & " " & j)
Next j
Next i
End Sub
:
20 11
: -14 28 18
18,5
-8 -14 -19 -18
25 28 26 20


11 18 20 25
2 1
2 3
3 4
. , :
Dim t(3, 4) As Integer
t(1, 1) = -8 : t(1, 2) = -14 : t(1, 3) = -19 : t(1, 4) = -18
t(2, 1) = 25 : t(2, 2) = 28 : t(2, 3) = 26 : t(2, 4) = 20
t(3, 1) = 11 : t(3, 2) = 18 : t(3, 3) = 20 : t(3, 4) = 25
:
Dim t ( , ) As Integer = { {99, 99, 99, 99, 99} , {99, -8, -14, -19, -18} , {99, 25, 28, 26, 20} , {99, 11, 18, 20, 25} }
. , , , , . , 0,1,2,3,4 0,1,2,3. . . 99, , .
104.  
.