Dim A (8) As Integer
dim Sum As Integer
Sum = 0
For i As Integer = 1 To 8
input A(i)
If A(i) > 0 Then
Sum = Sum + A(i)
End If
Next
print "Сумма положительных элементов = "; Sum
' -----------------------------------
Пример:
1
1
1
1
1
-1
1
3
Сумма положительных элементов = 9