Дана матрица 6 на 6 и число к (от 1 до 6) столбец с максимальным по модулю элементом в к-ой строке переставить с к-ым столбцом — PureBasic(Бейсик)

dim A(1 to 6, 1 to 6) as Double,B as Double
dim K as integer,I as integer,J as integer,L as integer
 
CLS
 
for I=1 to 6
for J=1 to 6
print "BBEDITE A",I,J
input A(I,J)
next J
next I
 
print "BBEDITE K"
input K
 
B=0
L=1
for I=1 to 6
if B<ABS(A(I,K)) then
B=ABS(A(I,K))
L=I
end if
next I
 
for J=1 to 6
B=A(L,J)
A(L,J)=A(K,J)
A(K,J)=B
next J
 
for I=1 to 6
for J=1 to 6
print A(I,J)
next J
next I
 
end

Leave a Comment