CLS
INPUT "Kolvo strok="; n
INPUT "kolvo stolbcov="; m
DIM a(n, m)
RANDOMIZE TIMER
FOR i = 1 TO n
FOR j = 1 TO m
a(i, j) = INT(RND * 101) - 50
NEXT j
NEXT i
PRINT "Matrica A"
FOR i = 1 TO n
FOR j = 1 TO m
PRINT a(i, j);
NEXT j
PRINT
NEXT i
min = 51
FOR j = 1 TO m
s = 0: k = 0
FOR i = 1 TO n
IF a(i, j) > 0 THEN s = s + a(i, j): k = k + 1
NEXT i
IF k > 0 THEN
s = s / k
PRINT "V stolbce #"; j; " srednee arifm polozhit elementov="; s
IF s < min THEN min = s
ELSE
PRINT "V stolbce #"; j; " net polozhitelnih elementov"
END IF
NEXT j
IF min < 51 THEN
PRINT "Naimenshee znachenie="; min
ELSE
PRINT "Ni v odnom stolbce net polozhit elementov"
END IF
Тестирование выполнено в программе QB64 ( Скачать )