Wow, I thought foreign forums would be more loyal. If you had seen how badly they teach in Russia... Everything has already been decided on the Russian forum and without further ado. The topic is closed.

program Project1;

label

a1,a2;

function f(xx: double):double;

begin

f:= xx;

end;

var

A,B,H,E,n: double;

x,x1,x0: double;

y,y1: double;

begin

writeln('Введите значение аргумента А:');

Readln(A);

writeln('Введите значение аргумента B:');

Readln(B);

writeln('Введите значение аргумента E:');

Readln(E);

writeln('Введите значение аргумента n:');

Readln(n);

H:= (B - A)/n;

a1:

x:= A;

a2:

y:= f(x);

x1:= x + H;

y1:= f(x1);

if y < y1 then

begin

x:= x + H;

if x <= B - H then

goto a2

else

writeln('Экстремума нет:');

end

else

begin

if y1 - y <= E then

begin

x0:=(B - 2*H)/2;

writeln('Результат вычислений:');

writeln('x0 = ',x0:0:4,'; f(x) = ',f(x):0:4,'; E = ',E:0:4,'; H = ',H:0:4);

end

else

begin

H:= H/4;

A:= x1 - 2*H;

B:= x1;

goto a1;

end;

end;

Readln;

end.