1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | input "Введите кол-во элементов в массиве ",n dim a(n),b(n),c(n) for i= 1 to n input "Введите элемент массива ",a(i) next for i= 1 to n s=s+a(i) next f=s/n for i= 1 to n if a(i)>f then k=k+ 1 :b(k)=a(i) else m=m+ 1 :c(m)=a(i) next print"massiv bolee srednego" for i= 1 to k print b(i); next print print"massiv menee srednego" for i= 1 to m print c(i); next |
Тестирование выполнено в программе QB64 ( Скачать )