CLS
n = 13
DIM a(n)
FOR i = 1 TO n
PRINT "vvedite element"; i
INPUT a(i)
NEXT
FOR i = 1 TO n
IF a(i) = 23 THEN EXIT FOR
s = s + a(i)
NEXT
CLS
FOR i = 1 TO n
PRINT a(i);
NEXT
PRINT
PRINT "summa ="; s
Тестирование выполнено в программе QB64 ( Скачать )