• Дана матрица А. Написать программу определения количества положительных и отрицательных элементов матрицы. Язык Visual Basic. [tex] \left[\begin{array}{ccc}-10&20&13\\-25&1&3\\4&12&-8\end{array}ight] [/tex]

Ответы 1

  • Private Sub Command1_Click()Dim myArray(3,3) as IntegerDim count_pos as IntegerDim cout_neg as IntegerDim i as IntegerDim j as Integercount pos = 0, count_neg = 0 For i = 0 to 3      For j = 0 to 3If (myArray(i,j) > 0) Thencount_pos = count_pos+1Else if (myArray(i,j) < 0) Thencount_neg = count_neg+1ElseEnd IfNext jNext iMsgBox("Положительных чисел " & count_pos & " ,а отрицательных " & count_neg); EndSub
    • Автор:

      averyizq5
    • 5 лет назад
    • 0
  • Добавить свой ответ

Еще вопросы

Войти через Google

или

Забыли пароль?

У меня нет аккаунта, я хочу Зарегистрироваться

How much to ban the user?
1 hour 1 day 100 years