CLS
RANDOMIZE TIMER
n = 10
DIM a(n, n), b(n, n)
FOR i = 1 TO n
FOR j = 1 TO n
a(i, j) = FIX(RND * 3 + 2)
NEXT
NEXT
FOR i = 1 TO n
b(i, i) = 1
FOR j = 1 TO n
b(i, i) = b(i, i) * a(j, i)
NEXT
NEXT
PRINT "massiv a"
FOR i = 1 TO n
FOR j = 1 TO n
PRINT a(i, j);
NEXT
PRINT
NEXT
PRINT "massiv b"
FOR i = 1 TO n
FOR j = 1 TO n
PRINT USING "#######"; b(i, j);
NEXT
PRINT
NEXT
Тестирование выполнено в программе QB64 ( Скачать )