program massiv; var i,n,max,sr,min,pozm,pozx:longint; a:array[1..10]of longint; begin for i:=1 to 10 do read(a[i]); for i:=1 to 10 do begin if a[i]>max then begin max:=a[i]; pozm:=i; end; if a[i]<min then begin max:=a[i]; pozx:=i; end; end; for i:= pozx+1 to pozm-1 do sr:=sr+a[i]; sr:=sr div (pozm-pozx); writeln(sr); end.
program massiv;
var i,n,max,sr,min,pozm,pozx:longint;
a:array[1..10]of longint;
begin
for i:=1 to 10 do
read(a[i]);
for i:=1 to 10 do
begin
if a[i]>max then begin max:=a[i]; pozm:=i; end;
if a[i]<min then begin max:=a[i]; pozx:=i; end;
end;
for i:= pozx+1 to pozm-1 do
sr:=sr+a[i];
sr:=sr div (pozm-pozx);
writeln(sr);
end.