CLS
INPUT "Kolvo strok="; n
INPUT "Kolvo stolbcov="; m
RANDOMIZE TIMER
DIM a(n, m)
FOR i = 1 TO n
FOR j = 1 TO m
a(i, j) = INT(RND * 101) - 50
NEXT j
NEXT i
PRINT
PRINT "Matrica A"
FOR i = 1 TO n
FOR j = 1 TO m
PRINT a(i, j);
NEXT j
PRINT
NEXT i
PRINT
s = 0
FOR i = 1 TO n
FOR j = 1 TO m
s = s + a(i, j)
NEXT j
NEXT i
PRINT "Summa vseh elementov="; s
PRINT
DIM b(n + 1, m)
FOR i = 1 TO n
FOR j = 1 TO m
b(i, j) = a(i, j)
NEXT j
NEXT i
FOR j = 1 TO m
d = 0
FOR i = 1 TO n
d = d + a(i, j)
NEXT i
d = d / s
b(n + 1, j) = d
NEXT j
PRINT "Rezultativnaya matrica"
FOR i = 1 TO n + 1
FOR j = 1 TO m
PRINT b(i, j);
NEXT j
PRINT
NEXT i
Тестирование выполнено в программе QB64 ( Скачать )