|
zadach85.BAS |
|
{* Задача85 *}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
Max = 0
For iy = 1 To N
For ix = 1 To N
If A(ix, iy) > Max Then Max = A(ix, iy): Ym = iy
Next ix, iy
PRINT " Max ="; Max; " Stroka:"; Ym
For i = 1 To N
SWAP A(i, 1), A(i, Ym)
Next
PRINT "Novaya matrica :"
For iy = 1 To N
For ix = 1 To N
PRINT A(ix, iy);
Next: PRINT
Next
End
|