DIM k(4, 4), h(4, 4)
RANDOMIZE TIMER
FOR i = 1 TO 4
FOR j = 1 TO 4
k(i, j) = INT(RND * 20)
h(i, j) = INT(RND * 20)
NEXT
NEXT
PRINT "matrica k"
FOR i = 1 TO 4
FOR j = 1 TO 4
PRINT k(i, j); " ";
NEXT
PRINT
NEXT
PRINT "matrica h"
FOR i = 1 TO 4
FOR j = 1 TO 4
PRINT h(i, j); " ";
NEXT
PRINT
NEXT
SWAP k(3, 3), k(3, 4)
FOR i = 1 TO 4
h(i, 4) = 17
NEXT
PRINT "novaya matrica k"
FOR i = 1 TO 4
FOR j = 1 TO 4
PRINT k(i, j); " ";
NEXT
PRINT
NEXT
PRINT "novaya matrica h"
FOR i = 1 TO 4
FOR j = 1 TO 4
PRINT h(i, j); " ";
NEXT
PRINT
NEXT
Результат работы программы
Тестирование выполнено в программе QB64 ( Скачать )