CLS
DIM x(10): DIM y(15)
RANDOMIZE TIMER
FOR i = 1 TO 10
x(i) = INT(RND * 100) - 50
NEXT i
FOR i = 1 TO 15
y(i) = INT(RND * 100) - 50
NEXT i
PRINT "Massiv x(10)"
FOR i = 1 TO 10
PRINT x(i);
NEXT i
PRINT
PRINT "Massiv y(15)"
FOR i = 1 TO 15
PRINT y(i);
NEXT i
PRINT
s = 0
FOR i = 1 TO 10
s = s + x(i)
NEXT i
xsr = s / 10
s = 0
FOR i = 1 TO 15
s = s + y(i)
NEXT i
ysr = s / 15
IF xsr > ysr THEN
PRINT "Massiv Y posle preobrazovaniy"
FOR i = 1 TO 15
IF y(i) < ysr THEN y(i) = 2.5
PRINT y(i);
NEXT i
ELSE
PRINT "Massiv X posle probrazovaniy"
FOR i = 1 TO 10
IF x(i) < xsr THEN x(i) = 10
PRINT x(i);
NEXT i
END IF
END
Тестирование выполнено в программе QB64 ( Скачать )