CLS
INPUT "kolvo strok="; n
INPUT "kolvo stolbcov="; m
DIM a(n, m)
FOR i = 1 TO n
FOR j = 1 TO m
INPUT "vvedite element matrici="; a(i, j)
NEXT j
NEXT i
FOR i = 1 TO n
FOR j = 1 TO m
PRINT a(i, j);
NEXT j
PRINT
NEXT i
PRINT
k = 0: s = 0
FOR j = 1 TO m
FOR i = 1 TO n
IF a(i, j) > 0 THEN k = k + 1
NEXT i
IF k = n THEN s = s + 1
k = 0
NEXT j
DIM b(n)
FOR i = 1 TO n
b(i) = a(i, 1)
FOR j = 2 TO m
IF a(i, j) > b(i) THEN b(i) = a(i, j)
NEXT j
NEXT i
PRINT "Kolvo stolbcov gde vse elementy>0="; s
PRINT "Massiv maksimalnih elementov kazhdoy stroki"
FOR i = 1 TO n
PRINT b(i);
NEXT i
END
Тестирование выполнено в программе QB64 ( Скачать )