INPUT " vvedite razmer massiva n ", n
DIM a(n)
RANDOMIZE time
PRINT "massiv"
FOR i = 1 TO n
a(i) = INT(RND * 20)
PRINT a(i); " ";
NEXT
PRINT
FOR i = 2 TO n - 1
s = s + a(i)
NEXT
PRINT "summa="; s
Тестирование выполнено в программе QB64 ( Скачать )