Помогите пожалуйста, Pascal
program one;
const n=10;
var a:array [1..n] of integer;
i, max,min,k,imax,imin,summ:integer;
begin
for i:=1 to n do
begin
a:=random(100);
write( a:4);
end;
max:=a;
imax:=1;
for i:=2 to n do
if max then a;
begin
min:=a;
imin:=i;
end;
summ:=0;
if imax<imin then
for k:=imax+1 to imin-1 do
summ:=summ+a[k]
else
for k:=imin+1 to imax-1 do
summ:=summ+a[k];
writeln;
for i:=1 to n do
write(a:4);
writeln;
writeln('Max= ',max);
writeln('imax= ', imax);
writeln('min= ', min);
writeln('imin ', imin);
writeln('summ ', summ);
end.
program one;
const n=10;
var a:array [1..n] of integer;
i, max,min,k,imax,imin,summ:integer;
begin
for i:=1 to n do
begin
a:=random(100);
write( a:4);
end;
max:=a;
imax:=1;
for i:=2 to n do
if max then a;
begin
min:=a;
imin:=i;
end;
summ:=0;
if imax<imin then
for k:=imax+1 to imin-1 do
summ:=summ+a[k]
else
for k:=imin+1 to imax-1 do
summ:=summ+a[k];
writeln;
for i:=1 to n do
write(a:4);
writeln;
writeln('Max= ',max);
writeln('imax= ', imax);
writeln('min= ', min);
writeln('imin ', imin);
writeln('summ ', summ);
end.
