|
zadach129.BAS |
|
{* Задача129 *}REM basic ' Вычислить количество отрицательных элементов каждого столбца матрицыCLS
RANDOMIZE TIMER
INPUT "vvedite n"; n
Dim a(n, n)
For i = 1 To n: For j = 1 To n
a(i, j) = INT(RND * 20 - 10)
Next: Next
For i = 1 To n: For j = 1 To n
PRINT a(i, j);
Next: PRINT: Next
For j = 1 To n: k = 0: For i = 1 To n
If a(i, j) < 0 Then k = k + 1
Next
PRINT "nomer stolbca ="; j; "kol-vo otricatelnyh jelementov:"; k
Next
End
|