DECLARE SUB DoVector (Matrix() AS DOUBLE, Vector() AS DOUBLE)
CLS
DIM SHARED m AS INTEGER, n AS INTEGER
INPUT "Kol-vo strok :"; n
INPUT "Kol-vo stolbcov :"; m
DIM SHARED Matr(m, n) AS DOUBLE, Vect(m) AS DOUBLE
DIM ix AS INTEGER, iy AS INTEGER
' Vvod dannyh
FOR iy = 1 TO n: FOR ix = 1 TO m
PRINT "Vvedite element v"; ix; "stolbce i"; iy; "stroke";
INPUT Matr(ix, iy)
NEXT ix, iy
' Raschet v podprogramme
DoVector Matr(), Vect()
COLOR 10: PRINT "REZULTAT:": COLOR 7
FOR ix = 1 TO n
PRINT Vect(ix);
NEXT ix
SUB DoVector (Matrix() AS DOUBLE, Vector() AS DOUBLE)
DIM sum#
FOR ix = 1 TO m
FOR iy = 1 TO n
sum# = sum# + ABS(Matrix(ix, iy))
NEXT
IF sum# > 100 THEN Vector(ix) = SQR(sum#) ELSE Vector(ix) = sum#
sum# = 0
NEXT
END SUB
Тестирование выполнено в программе QB64 ( Скачать )