INPUT "vedite razmer matricy "; n
DIM b(n, n), p(n * (n - 1) / 2)
PRINT "vvedite elementy matricy B"
FOR i = 1 TO n
FOR j = 1 TO n
PRINT "b("; i; ","; j; ")=";
INPUT "", b(i, j)
NEXT
NEXT
PRINT "ishodnaya matrica"
FOR i = 1 TO n
FOR j = 1 TO n
PRINT b(i, j);
NEXT
PRINT
NEXT
FOR i = 1 TO n
FOR j = 1 TO n
IF i > j THEN k = k + 1: p(k) = b(i, j): s = s + b(i, j)
NEXT
NEXT
PRINT "novyj massiv"
FOR i = 1 TO k
PRINT p(i);
NEXT
PRINT
PRINT "summa="; s
Тестирование выполнено в программе QB64 ( Скачать )