1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | 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 |