CLS
INPUT "Kolvo strok="; n
INPUT "Kolvo stolbcov="; m
RANDOMIZE TIMER
DIM a(n, m)
DIM b(n, m + 1)
FOR i = 1 TO n
FOR j = 1 TO m
a(i, j) = INT(RND * 2)
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
FOR i = 1 TO n
FOR j = 1 TO m
b(i, j) = a(i, j)
NEXT j
NEXT i
FOR i = 1 TO n
s = 0
FOR j = 1 TO m
IF a(i, j) = 1 THEN s = s + 1
NEXT j
IF s MOD 2 = 1 THEN
b(i, m + 1) = 1
ELSE
b(i, m + 1) = 0
END IF
NEXT i
PRINT "rezultativnaya matrica"
FOR i = 1 TO n
FOR j = 1 TO m + 1
PRINT b(i, j);
NEXT j
PRINT
NEXT i
Тестирование выполнено в программе QB64 ( Скачать )