CLS
INPUT "vvedite n"; n
DIM a(n)
FOR i = 1 TO n
INPUT "vvedite ozenku"; a(i)
NEXT
FOR i = 1 TO n
PRINT a(i);
NEXT
max = a(1): min = a(1)
FOR i = 1 TO n
IF max >= a(i) THEN max = a(i): k1 = i
IF min <= a(i) THEN min = a(i): k2 = i
s = s + a(i)
NEXT
s = (s - min - max) / (n - 2)
PRINT
PRINT "ozenka"; s
PRINT "max u"; k1
PRINT "min u"; k2
Тестирование выполнено в программе QB64 ( Скачать )