RANDOMIZE TIMER
CLS
DIM x(10), y(15)
s = 0
p = 0
PRINT "massiv x:"
FOR i = 1 TO 10
x(i) = INT(RND(1) * 20)
PRINT x(i)
s = s + x(i)
NEXT i
PRINT "massiv y:"
FOR j = 1 TO 15
y(j) = INT(RND(1) * 20)
PRINT y(j)
p = p + y(j)
NEXT j
PRINT
s = s / 10
p = p / 15
PRINT "s="; s, "p="; p
IF s > p THEN
PRINT "s>p": PRINT "novui massiv y:"
FOR j = 1 TO 15
y(j) = p - 2.5
PRINT y(j)
NEXT j
ELSE
PRINT "s<p": PRINT "novui massiv x:"
FOR i = 1 TO 10
x(i) = s - 10
PRINT x(i)
NEXT i
END IF
Тестирование выполнено в программе QB64 ( Скачать )