CLS
INPUT "vvedite n"; n
DIM a(n, n)
FOR i = 1 TO n: FOR j = 1 TO n
PRINT "vvedite a("; i; ","; j; ")"
INPUT a(i, j)
NEXT: NEXT
CLS
FOR i = 1 TO n: FOR j = 1 TO n
PRINT a(i, j);
NEXT: PRINT: NEXT
PRINT STRING$(80, 196)
FOR i = 2 TO n: FOR j = 1 TO i - 1
SWAP a(i, j), a(j, i)
NEXT: NEXT
FOR i = 1 TO n: FOR j = 1 TO n
PRINT a(i, j);
NEXT: PRINT: NEXT
Тестирование выполнено в программе QB64 ( Скачать )