INPUT "vvedite razmer matricy N ", n
DIM a(n, n)
RANDOMIZE TIMER
PRINT "ishodnaya matrica"
FOR i = 1 TO n
FOR j = 1 TO n
a(i, j) = INT(RND * 100) + 1
PRINT a(i, j);
NEXT
PRINT
NEXT
FOR i = 1 TO n
a(i, i) = 0
PRINT "novaya matrica"
FOR i = 1 TO n
FOR j = 1 TO n
PRINT a(i, j);
NEXT
PRINT
NEXT
NEXT
Тестирование выполнено в программе QB64 ( Скачать )