Visual Basic NET ( 2)


           


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