INPUT "vvedite razmer matricy N ", n
DIM a(n, n)
INPUT "vvedite chislo K ", k
RANDOMIZE TIMER
PRINT "massiv"
FOR i = 1 TO n
FOR j = 1 TO n
a(i, j) = INT(RND * 100)
PRINT a(i, j);
NEXT
PRINT
NEXT
max = 0
FOR i = 1 TO n
FOR j = 1 TO n
IF a(i, j) MOD k = 0 THEN m = m + 1: IF a(i, j) > max THEN max = a(i, j)
NEXT
NEXT
PRINT "kol-vo kratnyh k="; m
PRINT "naibolshij iz nih="; max
Тестирование выполнено в программе QB64 ( Скачать )