INPUT "vv. kol-vo chisel ", n
INPUT " vv. chislo q=", q
RANDOMIZE TIMER
DIM a(n)
PRINT "chisla"
FOR i = 1 TO n
a(i) = INT(RND * 10) - 10
PRINT a(i);
NEXT
PRINT
PRINT "rezultat"
FOR i = 1 TO n
IF a(i) MOD q = 0 THEN PRINT a(i): f = 1
NEXT
IF f = 0 THEN PRINT "chisla ne delyatsyz na "; q
Тестирование выполнено в программе QB64 ( Скачать )