DIM a(6)
FOR i = 1 TO 6
INPUT a(i)
NEXT i
min = a(1)
max = a(1)
imin = 1
imax = 1
FOR i = 2 TO 6
IF a(i) < min THEN
min = a(i)
imin = i
END IF
IF a(i) > max THEN
max = a(i)
imax = i
END IF
NEXT i
IF imin < imax THEN
FOR i = imin + 1 TO imax - 1
IF a(i) > 0 THEN
sum = sum + a(i)
k = k + 1
END IF
NEXT i
PRINT "summa="; sum, "k="; k
ELSE PRINT "Решения нет"
END IF