CLS
RANDOMIZE TIMER
n = 10
DIM a(n)
FOR i = 1 TO n: a(i) = FIX(RND * 100): NEXT
FOR i = 1 TO n: s = s + a(i): NEXT
FOR i = 1 TO s
IF s MOD i = 0 THEN k = k + 1
NEXT
PRINT "massiv"
FOR i = 1 TO n
PRINT a(i);
NEXT
PRINT
PRINT "chislo elementov"; n
PRINT "s ="; s
IF k = 2 THEN PRINT "prostoe" ELSE PRINT "net"
Тестирование выполнено в программе QB64 ( Скачать )