Задана квадратная матрица. Исключить из нее строку и столбец, на пересечении которых расположен максимальный элемент главной диагонали — Basic(Бейсик)

INPUT "vvedite razmer ", n
DIM a(n, n)
FOR i = 1 TO n
FOR j = 1 TO n
INPUT "vvedite element"; a(i, j)
NEXT
NEXT
PRINT "matrica"
FOR i = 1 TO n
FOR j = 1 TO n
PRINT a(i, j); ' ';
NEXT
PRINT
NEXT
max = a(1, 1)
ni = 1
nj = 1
FOR i = 2 TO n
IF a(i, i) > max THEN max = a(i, i): ni = i: nj = i
NEXT
FOR i = ni TO n - 1
FOR j = 1 TO n
a(i, j) = a(i + 1, j)
NEXT
NEXT
FOR i = 1 TO n - 1
FOR j = nj TO n - 1
a(i, j) = a(i, j + 1)
NEXT
NEXT
PRINT "novaya matrica"
FOR i = 1 TO n - 1
FOR j = 1 TO n - 1
PRINT a(i, j); ' ';
NEXT
PRINT
NEXT

Leave a Comment