CLS
flag = 0
DO WHILE flag = 0
' Генерируем случайную матрицу
LOCATE 1, 1
RANDOMIZE TIMER
FOR i = 1 TO 4
SUM(i) = 0
FOR j = 1 TO 4
A(i, j) = INT(RND * 15 + 1)
PRINT USING "####"; A(i, j);
SUM(i) = SUM(i) + A(i, j)
NEXT j
PRINT " s="; SUM(i)
NEXT i
' Проверяем суммы по строкам
IF SUM(1) = SUM(2) AND aum(2) = SUM(3) AND SUM(3) = SUM(4) THEN
flag = 1
PRINT "Матрица найдена!"
END IF
SLEEP
LOOP