CLS
INPUT "n="; n
DIM a(n)
RANDOMIZE TIMER
FOR i = 1 TO n
a(i) = INT(RND * 101) - 50
NEXT i
PRINT "Posledovatelnost a"
FOR i = 1 TO n
PRINT a(i);
NEXT i
PRINT
imax = 1
FOR i = 2 TO n
IF a(i) > a(imax) THEN imax = i
NEXT i
IF imax < n THEN
k = n - imax
DIM b(k)
FOR i = 1 TO k
b(i) = a(i + imax)
NEXT i
PRINT "Posledovatelnost b"
FOR i = 1 TO k
PRINT b(i);
NEXT i
ELSE
PRINT "Posle maksim elementa posledovat a elementov net"
END IF
Тестирование выполнено в программе QB64 ( Скачать )