INPUT "vvedite kol-vo strok ", m
INPUT "vvedite kol-vo stolbcov ", n
DIM h(m, n)
RANDOMIZE TIMER
FOR i = 1 TO m
FOR j = 1 TO n
h(i, j) = INT(RND * 100) - 50
NEXT
NEXT
PRINT "massiv"
FOR i = 1 TO m
FOR j = 1 TO n
PRINT h(i, j);
NEXT
PRINT
NEXT
max = h(1, 1)
sum = 0
kol = 0
FOR i = 1 TO m
sum = 0
FOR j = 1 TO n
IF h(i, j) > max THEN max = h(i, j)
IF h(i, j) < 0 THEN sum = sum + h(i, j): kol = kol + 1
NEXT
sr = sum / kol
PRINT "stroka="; i;
IF sr <> 0 THEN PRINT " srednee="; sr ELSE PRINT "otricatelnyh net"
NEXT
Следующий вариант
INPUT "vvedite kol-vo strok ", m
INPUT "vvedite kol-vo stolbcov ", n
DIM h(m, n)
FOR i = 1 TO m
FOR j = 1 TO n
INPUT "vvedite element ", h(i, j)
NEXT
NEXT
PRINT "massiv"
FOR i = 1 TO m
FOR j = 1 TO n
PRINT h(i, j);
NEXT
PRINT
NEXT
max = h(1, 1)
sum = 0
kol = 0
FOR i = 1 TO m
sum = 0
FOR j = 1 TO n
IF h(i, j) > max THEN max = h(i, j)
IF h(i, j) < 0 THEN sum = sum + h(i, j): kol = kol + 1
NEXT
sr = sum / kol
PRINT "stroka="; i;
IF sr <> 0 THEN PRINT " srednee="; sr ELSE PRINT "otricatelnyh net"
NEXT
Тестирование выполнено в программе QB64 ( Скачать )