CLS
RANDOMIZE TIMER
n = 15
DIM a(n), b(n)
FOR i = 1 TO n
a(i) = FIX(RND * 100)
b(i) = FIX(RND * 100)
NEXT
PRINT "massiv a"
FOR i = 1 TO n
PRINT a(i);
NEXT
PRINT
PRINT "massiv b"
FOR i = 1 TO n
PRINT b(i);
NEXT
PRINT
PRINT STRING$(80, 196)
FOR i = 1 TO n
IF a(i) < b(i) THEN
a(i) = a(i) + a(i)
b(i) = b(i) + a(i) / 2
ELSE
a(i) = a(i) + b(i)
b(i) = b(i) + b(i)
END IF
NEXT
min = b(1)
FOR i = 1 TO n
sr = sr + a(i)
IF b(i) < min THEN min = b(i)
NEXT
sr = sr / n
PRINT "new massiv a"
FOR i = 1 TO n
PRINT a(i);
NEXT
PRINT
PRINT "new massiv b"
FOR i = 1 TO n
PRINT b(i);
NEXT
PRINT
PRINT STRING$(80, 196)
PRINT "srednee arifmeticheskoe massiva a:"; sr
PRINT "min massiva b:"; min
Тестирование выполнено в программе QB64 ( Скачать )