исходная матрица
1 -2 6
2 11 4
-3 -7 -4
DATA 1,-2,6,2,11,4,-3,-7,-4 'formiruem spisok elementov
DIM a(3, 3) 'obyavlyaem massiv
FOR i = 1 TO 3
FOR j = 1 TO 3
READ a(i, j) 'schitivaem dannie iz spiska v massiv
NEXT
NEXT
PRINT "massiv"
FOR i = 1 TO 3
FOR j = 1 TO 3
PRINT a(i, j); 'vivodim matritsu na ekran
NEXT
PRINT
NEXT
pr = 1 'zadayom nachalnoe proizvedenie
FOR i = 1 TO 3
IF a(i, i) < 0 THEN sot = sot + a(i, i) 'esli element glavnoi diagonali otritsatelen, pribavlyaem yego k summe
NEXT
FOR i = 1 TO 3
FOR j = 1 TO 3
IF i MOD 2 = 1 AND j MOD 2 = 1 THEN pr = pr * a(i, j)
'esli indeksi nechyotnie, to umnozhaem proizvedenie na element
NEXT
NEXT
IF sot < pr THEN D = sot * pr ELSE D = sot / pr ' opredelyaem, chemu budet ravno D
PRINT "D="; D 'vivodim D
Тестирование выполнено в программе QB64 ( Скачать )