CLS
RANDOMIZE TIMER
n = 10
DIM a(n), b(n), c(n)
FOR i = 1 TO n: a(i) = FIX(RND * 100): NEXT
FOR i = 1 TO n: b(i) = FIX(RND * 100): NEXT
FOR i = 1 TO n: c(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 "massiv c"
FOR i = 1 TO n
PRINT c(i);
NEXT
PRINT
FOR i = 1 TO n
IF c(i) < a(i) AND c(i) < b(i) THEN c(i) = c(i) / 2
NEXT
min = 1E38
FOR i = 1 TO n
IF c(i) < min THEN min = c(i): k = i
NEXT
FOR i = 1 TO k
s = s + c(i)
NEXT
PRINT "new massiv c"
FOR i = 1 TO n
PRINT c(i);
NEXT
PRINT
PRINT "s ="; s
DEFINT A-Z
CLS
INPUT "Vvedite kol-vo elementov : ", n
DIM A(n), B(n), C(n)
RANDOMIZE TIMER
FOR i = 1 TO n
A(i) = RND * 50
B(i) = RND * 50
C(i) = RND * 50
PRINT A(i), B(i), C(i)
NEXT
PRINT STRING$(40, 196)
FOR i = 1 TO n
IF C(i) < A(i) AND C(i) < B(i) THEN C(i) = C(i) / 2
PRINT C(i);
S = S + C(i)
IF i = 1 THEN Min = C(i): Sum = S
IF C(i) < Min THEN Min = C(i): Sum = S
NEXT: PRINT
PRINT "Summa :"; Sum
Тестирование выполнено в программе QB64 ( Скачать )