DIM b(4, 6)
RANDOMIZE TIMER
FOR i = 1 TO 4
FOR j = 1 TO 6
b(i, j) = INT(RND * 21) - 10
NEXT
NEXT
PRINT "matrica"
FOR i = 1 TO 4
FOR j = 1 TO 6
PRINT b(i, j);
NEXT
PRINT
NEXT
FOR i = 1 TO 4
max = b(i, 1)
FOR j = 1 TO 6
IF b(i, j) < 0 THEN s = s + b(i, j): k = k + 1
IF b(i, j) > max THEN max = b(i, j)
NEXT
sum = sum + max
NEXT
PRINT "srednee otricatelnyh elementov="; s / k
PRINT "summa maximumov strok="; sum
Тестирование выполнено в программе QB64 ( Скачать )