|
zadach86.BAS |
|
{* Задача86 *}REM basic ' Дан массив A(N, N), состоящий из случайных двухзначных чисел. Поменять в массиве последний столбец со столбцом, содержащим минимальный элемент.CLS : INPUT "Vvedite N: ", N
Dim A(N, N) As Integer
RANDOMIZE TIMER
For iy = 1 To N
For ix = 1 To N
A(ix, iy) = RND * 89 + 10
PRINT A(ix, iy);
Next: PRINT
Next
Min = 100
For iy = 1 To N
For ix = 1 To N
If A(ix, iy) < Min Then Min = A(ix, iy): Xm = ix
Next ix, iy
PRINT " Min ="; Min; " Stolbec:"; Xm
For i = 1 To N
SWAP A(N, i), A(Xm, i)
Next
PRINT "Novaya matrica :"
For iy = 1 To N
For ix = 1 To N
PRINT A(ix, iy);
Next: PRINT
Next
End
|