|
zadach88.BAS |
|
{* Задача88 *}REM basic ' Отсортировать строки массива A(N, M) из случайных чисел от 10 до 25 по убыванию элементов.CLS : INPUT "Vvedite M(stolbc): ", M
INPUT "Vvedite N(stroki): ", N
Dim A(M, N) As Integer
RANDOMIZE TIMER
For iy = 1 To N
For ix = 1 To M
A(ix, iy) = RND * 15 + 10
PRINT A(ix, iy);
Next: PRINT
Next
For iy = 1 To N
For j = M - 1 To 1 Step -1
For ix = 1 To j
If A(ix, iy) < A(ix + 1, iy) Then SWAP A(ix, iy), A(ix + 1, iy)
Next ix, j
Next
PRINT "Novaya matrica: "
For iy = 1 To N
For ix = 1 To M
PRINT A(ix, iy);
Next: PRINT
Next
End
|