Предмет: Информатика,
автор: rekebab
Дана матрица А. Написать программу определения количества положительных и отрицательных элементов матрицы. Язык Visual Basic.
Ответы
Автор ответа:
0
Private Sub Command1_Click()
Dim myArray(3,3) as Integer
Dim count_pos as Integer
Dim cout_neg as Integer
Dim i as Integer
Dim j as Integer
count pos = 0, count_neg = 0
For i = 0 to 3
For j = 0 to 3
If (myArray(i,j) > 0) Then
count_pos = count_pos+1
Else if (myArray(i,j) < 0) Then
count_neg = count_neg+1
Else
End If
Next j
Next i
MsgBox("Положительных чисел " & count_pos & " ,а отрицательных " & count_neg);
EndSub
Dim myArray(3,3) as Integer
Dim count_pos as Integer
Dim cout_neg as Integer
Dim i as Integer
Dim j as Integer
count pos = 0, count_neg = 0
For i = 0 to 3
For j = 0 to 3
If (myArray(i,j) > 0) Then
count_pos = count_pos+1
Else if (myArray(i,j) < 0) Then
count_neg = count_neg+1
Else
End If
Next j
Next i
MsgBox("Положительных чисел " & count_pos & " ,а отрицательных " & count_neg);
EndSub
Похожие вопросы
Предмет: Химия,
автор: bot148
Предмет: Русский язык,
автор: Аноним
Предмет: Геометрия,
автор: poliakovanastya2006
Предмет: Физика,
автор: alinagundorina
Предмет: Геометрия,
автор: popo0707