1 2 3 4 5 6 7 8 9 10 11 12 | CLS N= 13 DIM a(n) For i= 1 to n Print "a(";i;")="; input a(i) next i for i= 1 to n if a(i) = 39 Then exit for s=s+a(i) next i print "summa=";s |
Тестирование выполнено в программе QB64 ( Скачать )
1 2 3 4 5 6 7 8 9 10 11 12 | CLS N= 13 DIM a(n) For i= 1 to n Print "a(";i;")="; input a(i) next i for i= 1 to n if a(i) = 39 Then exit for s=s+a(i) next i print "summa=";s |
Тестирование выполнено в программе QB64 ( Скачать )