CLS
INPUT "Razmernost matrici="; n
DIM a(n, n)
RANDOMIZE TIMER
FOR i = 1 TO n
FOR j = 1 TO n
a(i, j) = INT(RND * 101) - 50
NEXT j
NEXT i
PRINT "Ishodnaya Matrica A"
FOR i = 1 TO n
FOR j = 1 TO n
PRINT a(i, j);
NEXT j
PRINT
NEXT i
PRINT
INPUT "k="; k
FOR j = 1 TO n
a(k, j) = a(k, j) / a(k, k)
NEXT j
PRINT "Matrica A posle preobrazovaniy"
FOR i = 1 TO n
FOR j = 1 TO n
PRINT a(i, j);
NEXT j
PRINT
NEXT i
PRINT
s = 0
FOR i = 1 TO n
s = s + ((a(i, k)) ^ 2)
NEXT i
PRINT "Summa kvadratov k-go stolbca="; s
END
Тестирование выполнено в программе QB64 ( Скачать )