10 REM
20 CLS
30 DIM A(30)
40 FOR i = 1 TO 30
50 PRINT "Vvedite "; i; " element massiva"
60 INPUT A(i)
70 NEXT i
80 FOR i = 1 TO 30
90 IF A(i) < 0 THEN k = k + 1: m = m + ABS(A(i))
100 IF A(i) > 0 THEN t = t + 1: s = s + ABS(A(i))
110 NEXT i
120 PRINT "Summa poloj elementov="; s; "Kolvo polojitelniyh elementov"; t
130 PRINT "Summa otricatelnih elementov"; m; "Kolvo otricatelnih elementov"; k
140 END
Тестирование выполнено в программе QB64 ( Скачать )