Двумерный массив. , , номера 1, 10, 11. любой, какой сможете ​

HNLLZ HNLLZ    3   15.05.2019 01:22    3

Ответы
40523 40523  10.06.2020 06:34

Объяснение:

1.

Sub Button1_click()

Dim matrix(1 To 2, 1 To 3) As Integer

For i = 1 To 3

 matrix(1, i) = 1 ^ 2 + i ^ 2

 matrix(2, i) = -matrix(1, i)

Next i

prompt = ""

For i = 1 To 2

 For j = 1 To 3

  If matrix(i, j) > 0 Then

  prompt = prompt & "       " & matrix(i, j)

  Else

  prompt = prompt & "      " & matrix(i, j)

  End If

  Next j

 prompt = prompt & Chr(13)

Next i

MsgBox prompt

End Sub

10.

Sub Button1_click()

Dim matrix(1 To 2, 1 To 3) As Integer

upperbound = 25

lowerbound = -25

For i = 1 To 2

   For j = 1 To 3

       Randomize

       matrix(i, j) = Int((upperbound - lowerbound + 1) * Rnd + lowerbound)

   Next j

Next i

prompt = ""

For i = 1 To 2

 For j = 1 To 3

 If Abs(matrix(i, j)) > 9 And Abs(matrix(i, j)) < 99 Then

 prompt = prompt & "A(" & i & "," & j & ")=" & matrix(i, j) & Chr(13)

 End If

 Next j

Next i

prompt = prompt & Chr(13)

For i = 1 To 2

 For j = 1 To 3

  If matrix(i, j) > 0 Then

  prompt = prompt & "       " & matrix(i, j)

  Else

  prompt = prompt & "      " & matrix(i, j)

  End If

  Next j

 prompt = prompt & Chr(13)

Next i

MsgBox prompt

End Sub

11.

Sub Button1_click()

Dim matrix(1 To 9, 1 To 9) As Integer

For i = 1 To 9

   For j = 1 To 9

       If i = j Or i = 9 + 1 - j Then

           matrix(i, j) = 1

       Else

           matrix(i, j) = 0

       End If

   Next j

Next i

prompt = ""

For i = 1 To 9

 For j = 1 To 9

     prompt = prompt & "   " & matrix(i, j)

  Next j

 prompt = prompt & Chr(13)

Next i

MsgBox prompt

End Sub

ПОКАЗАТЬ ОТВЕТЫ
Другие вопросы по теме Информатика