1 2 3 4 5 6 7 8 9 10 11 12 | DIM M( 1 TO 4 , 1 TO 4 ), MAXEL ' Zapolnim matritsu sluchainimi znacheniyami RANDOMIZE TIMER FOR y = 1 TO 4 : FOR x = 1 TO 4 M(x, y) = (RND * 100 ) - 50 NEXT: NEXT ' Ishchem maksimalnii element v 3 -i stroke MAXEL = M( 1 , 3 ) FOR x = 1 TO 4 IF M(x, 3 ) > MAXEL THEN MAXEL = M(x, 3 ) NEXT PRINT "Maksimalnyj element:"; MAXEL |
Тестирование выполнено в программе QB64 ( Скачать )