Дана матрица C(N,N). Сформировать одномерный массив из сумм каждого столбца матрицы — Basic(Бейсик)

DIM c(),x(),mini(),diag()
 
INPUT "BBOD", n
REDIM c(n,n)
REDIM x(n)
REDIM mini(n)
REDIM diag(n)
 
FOR i=1 TO n
FOR j=1 TO n
INPUT "BBOD", c(i.j)
NEXT j
NEXT i
 
FOR i=1 TO n
x(i)=0
FOR j=1 TO n
x(i)=x(i)+c(i,j)
NEXT j
PRINT x(i),i
NEXT i
 
FOR i=1 TO n
FOR j=1 TO n
IF j=i THEN diag(i)=c(i,j)
NEXT j
PRINT diag(i),i
NEXT i
 
FOR j=1 TO n
mini(j)=c(1,j)
FOR i=2 TO n
IF mini(j)<c(i,j) THEN mini(j)=c(i,j)
NEXT i
PRINT mini(j),j
NEXT j

Leave a Comment