CLS
DIM R(8, 7) AS INTEGER
FOR i = 1 TO 8
FOR j = 1 TO 7
R(i, j) = RND(TIMER) * 200 - 100
NEXT j
NEXT i
DIM M(8) AS INTEGER
FOR i = 1 TO 8
negative = 0
positive = 0
FOR j = 1 TO 7
IF R(i, j) > 0 THEN
positive = positive + 1
END IF
IF R(i, j) < 0 THEN
negative = negative + 1
END IF
NEXT j
IF negativ >= positiv THEN
M(i) = 1
END IF
IF negative < positive THEN
M(i) = 0
END IF
NEXT i
FOR i = 1 TO 8
PRINT M(i);
FOR j = 1 TO 7
PRINT R(i, j);
NEXT j
PRINT
NEXT i
Тестирование выполнено в программе QB64 ( Скачать )