CLS
INPUT "Razmernost kvadratnoy matrici="; m
DIM a(m, m)
RANDOMIZE TIMER
FOR i = 1 TO m
FOR j = 1 TO m
a(i, j) = INT(RND * 100) - 50
NEXT j
NEXT i
FOR i = 1 TO m
FOR j = 1 TO m
PRINT a(i, j);
NEXT j
PRINT
NEXT i
PRINT
n = 0: r = 0
FOR i = 1 TO m
IF a(i, 1) <> 0 THEN n = n + 1
NEXT i
FOR j = 1 TO m
IF a(m, j) <> 0 THEN r = r + 1
NEXT j
DIM p(n): DIM s(r)
k = 0: t = 0
FOR i = 1 TO m
IF a(i, 1) <> 0 THEN
k = k + 1
p(k) = 1
FOR j = 1 TO m
p(k) = p(k) * a(i, j)
NEXT j
END IF
NEXT i
FOR j = 1 TO m
IF a(m, j) <> 0 THEN
t = t + 1
s(t) = 0
FOR i = 1 TO m
s(t) = s(t) + a(i, j)
NEXT i
END IF
NEXT j
PRINT "Massiv iz proizv elementov strok"
FOR i = 1 TO n
PRINT p(i);
NEXT i
PRINT
PRINT "Massiv iz summ elementov stolbcov"
FOR i = 1 TO r
PRINT s(i);
NEXT i
Тестирование выполнено в программе QB64 ( Скачать )