двумерный массив. помогите, пожалуйста, номера 1, 10, 11. хоть какой, какой можете
Двумерный массив. помогите, пожалуйста, номера 1, 10, 11. любой, какой сможете
Задать свой вопросОтвет:
Изъяснение:
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) gt; 0 Then
prompt = prompt amp; " " amp; matrix(i, j)
Else
prompt = prompt amp; " " amp; matrix(i, j)
End If
Next j
prompt = prompt amp; 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)) gt; 9 And Абс(matrix(i, j)) lt; 99 Then
prompt = prompt amp; "A(" amp; i amp; "," amp; j amp; ")=" amp; matrix(i, j) amp; Chr(13)
End If
Next j
Next i
prompt = prompt amp; Chr(13)
For i = 1 To 2
For j = 1 To 3
If matrix(i, j) gt; 0 Then
prompt = prompt amp; " " amp; matrix(i, j)
Else
prompt = prompt amp; " " amp; matrix(i, j)
End If
Next j
prompt = prompt amp; 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 amp; " " amp; matrix(i, j)
Next j
prompt = prompt amp; Chr(13)
Next i
MsgBox prompt
End Sub
-
Вопросы ответы
Статьи
Информатика
Статьи
Математика.
Разные вопросы.
Разные вопросы.
Математика.
Разные вопросы.
Математика.
Физика.
Геометрия.
Разные вопросы.
Обществознание.