CLS
INPUT "Vvedite razmer strok v matritse: ", n
INPUT "Vvedite razmer stolbtsov v matritse: ", m
DIM a(n, m), p(m)
PRINT: PRINT " * Matritsa * ": PRINT
FOR i = 1 TO n
FOR j = 1 TO m
a(i, j) = i * j
PRINT USING "########"; a(i, j);
NEXT j
PRINT
NEXT i
PRINT
k1 = 1E+38
k2 = -1E+38
PRINT " Proizvedenie elementov kazhdogo stolbtsa": PRINT
FOR j = 1 TO m
k = 1
FOR i = 1 TO n
k = k * a(i, j)
NEXT i
p(j) = k
IF p(j) < k1 THEN k1 = j
IF p(j) > k2 THEN k2 = j
PRINT USING "########"; p(j);
NEXT j
PRINT: PRINT
PRINT " Pomenyali mestami stolbtsi s maksimalnim "
PRINT " i minimalnim znacheniem proizvedeniya:"
FOR i = 1 TO n
SWAP a(i, k1), a(i, k2)
NEXT i
PRINT
FOR i = 1 TO n
FOR j = 1 TO m
PRINT USING "########"; a(i, j);
NEXT j
PRINT
NEXT i
Тестирование выполнено в программе QB64 ( Скачать )