DIM n AS INTEGER, i AS INTEGER
DIM sum AS INTEGER
DIM amnEvn AS INTEGER, amnOdd AS INTEGER
DIM prdEvn AS LONG, prdOdd AS LONG
INPUT "Enter How Many Indexes Has An Array: ", n
DIM mas(n) AS INTEGER
FOR i = 1 TO n
DO
PRINT "Enter An"; i; " Value: "
INPUT "", mas(i)
LOOP UNTIL mas(i)
NEXT i
FOR i = 1 TO n
PRINT "Index #"; i; "="; mas(i)
NEXT i
prdEvn = 1
prdOdd = 1
FOR i = 1 TO n
IF mas(i) MOD 2 = 0 THEN
amnEvn = amnEvn + 1
prdEvn = prdEvn * mas(i)
ELSE
amnOdd = amnOdd + 1
prdOdd = prdOdd * mas(i)
END IF
NEXT i
IF amnEvn = 0 THEN
prdEvn = 0
END IF
IF amnOdd = 0 THEN
prdOdd = 0
END IF
PRINT
PRINT
IF amnEvn > amnOdd THEN
PRINT "Even More Tnan Odd"
ELSEIF amnEvn < amnOdd THEN
PRINT "Odd More Than Even"
ELSE
PRINT "Number of Even Equals Number of Odd"
END IF
PRINT "Amount of Even: "; amnEvn
PRINT "Amount of Odd: "; amnOdd
PRINT "Product of Even: "; prdEvn
PRINT "Product of Odd: "; prdOdd
END
Тестирование выполнено в программе QB64 ( Скачать )