INPUT "vvedite kol-vo elementov ", n
DIM a(n)
RANDOMIZE TIMER
PRINT "posledovatelnost"
FOR i = 1 TO n
a(i) = INT(RND * 100)
PRINT a(i);
NEXT
PRINT
p = a(1)
FOR i = 2 TO n
IF a(i) > a(i - 1) THEN k1 = k1 + 1
IF a(i) < a(i - 1) THEN k2 = k2 + 1
p = p * a(i)
NEXT
IF (k1 <> n - 1) AND (k2 <> n - 1) THEN PRINT "srednee geometricheskoe="; p ^ (1 / n) ELSE PRINT "posledovatelnost uporyadochena"