CLS
INPUT "razmernost massiva";n
DIM a(n)
RANDOMIZE TIMER
FOR i =1 TO n
a(i)=INT(RND(1)*50+1)
NEXT i
max = a(1)
for i =1 to n
if a(i)>max then max=a(i)
next i
for i = 1 to n
? a(i);
next
?
for i =1 to n
if a(i)=max then k=k+1
if a(i)=max and k=3 then ? i
next i
if k<3 then ? "max elementov <3"
Тестирование выполнено в программе QB64 ( Скачать )