DIM a(15), b(8), c(7)
RANDOMIZE TIMER
FOR i = 1 TO 15
a(i) = INT(RND * 20)
NEXT
PRINT "massiv"
FOR i = 1 TO 15
PRINT a(i);
NEXT
PRINT
FOR i = 1 TO 15
IF i MOD 2 <> 0 THEN k = k + 1: b(k) = a(i): s1 = s1 + b(k) ELSE m = m + 1: c(m) = a(i): s2 = s2 + c(m)
NEXT
PRINT "massiv nechetnyh nomerov"
FOR i = 1 TO 8
PRINT b(i);
NEXT
PRINT
PRINT "summa massiva="; s1
PRINT "massiv chetnyh nomerov"
FOR i = 1 TO 7
PRINT c(i);
NEXT
PRINT
PRINT "summa massiva="; s2
IF s1 > s2 THEN PRINT "1 summa >" ELSE IF s2 > s1 THEN PRINT "2 summa>" ELSE PRINT "summy odinakovy"
Тестирование выполнено в программе QB64 ( Скачать )