CLS
INPUT "vvedite kolichestvo strok"; ny
INPUT "vvedite kolichestvo stolbcov"; nx
DIM a(ny, nx)
FOR y = 1 TO ny
FOR x = 1 TO nx
PRINT "vvedite element"; y; "stroka"; x; "stolbec"
INPUT a(y, x)
NEXT
NEXT
CLS
PRINT "massiv"
FOR y = 1 TO ny
FOR x = 1 TO nx
PRINT a(y, x);
NEXT
PRINT
NEXT
min = 1E38
FOR y = 1 TO ny
FOR x = 1 TO nx
IF ABS(a(y, x)) < ABS(min) THEN min = a(y, x): k = y
NEXT
NEXT
FOR y = 1 TO ny
FOR x = 1 TO nx
IF y = k THEN SWAP a(k, x), a(2, x)
NEXT
NEXT
PRINT "new massiv"
FOR y = 1 TO ny
FOR x = 1 TO nx
PRINT a(y, x);
NEXT
PRINT
NEXT
Тестирование выполнено в программе QB64 ( Скачать )