DECLARE SUB Summa (A!())
CLS
DIM SHARED m%
DIM SHARED n%
INPUT "kol-vo strok"; m%
INPUT "kol-vo stolbtsov"; n%
DIM A!(m%, n%)
FOR i% = 1 TO m%
FOR j% = 1 TO n%
INPUT "vvedite element"; A!(i%, j%)
NEXT: PRINT: NEXT
PRINT "matrica"
FOR i% = 1 TO m%
FOR j% = 1 TO n%
PRINT A!(i%, j%);
NEXT: PRINT: NEXT
CALL Summa(A!())
END
SUB Summa (A!())
Sum! = 0
FOR i% = 1 TO m%: FOR j% = 1 TO n%
IF (i% > j%) AND ((A!(i%, j%)) < 0) THEN Sum! = Sum! + A!(i%, j%)
NEXT: NEXT
PRINT "Summ="; Sum!
END SUB
Тестирование выполнено в программе QB64 ( Скачать )