INPUT "razmernost massiva ", n
DIM a(n, n)
FOR i = 1 TO n
FOR j = 1 TO n
INPUT "element ", a(i, j)
NEXT
NEXT
INPUT "interval ot ", d
INPUT "interval do ", b
s = 0
FOR i = 1 TO n
FOR j = 1 TO n
IF (a(i, j) >= d) AND (a(i, j) <= b) THEN s = s + a(i, j)
NEXT j
NEXT i
PRINT "Summa elementov popadayushih v interval ot "; d; "do"; b; "="; s
Тестирование выполнено в программе QB64 ( Скачать )