var x,y: integer;
var min,max: Real;
var Z: real;
var step: Real;
begin
writeln('Введите x: ');
readln(x);
writeln('Введите y: ');
readln(y);
if x<=0 then
max:= x+y;
if max<((x*y)/2) then
max:= (x*y)/2;
writeln('Max: ', max);
end;
else
for i:=1 to 0.5 do step:=step*(x*0.5);
min:= step;
if(min > (x+y)/2) then
min:= (x+y)/2;
writeln('Min: ', min);
end.
PascalABC.NET
var (x, y) := ReadReal2('Введи х и у;');
var z: real;
if x <= 0 then
z := Max(x + y, x * y / 2)
z := Min(Sqrt(x * y), x + y * 2);
Print(z)
var x,y: integer;
var min,max: Real;
var Z: real;
var step: Real;
begin
writeln('Введите x: ');
readln(x);
writeln('Введите y: ');
readln(y);
if x<=0 then
begin
max:= x+y;
if max<((x*y)/2) then
begin
max:= (x*y)/2;
writeln('Max: ', max);
end;
else
begin
for i:=1 to 0.5 do step:=step*(x*0.5);
min:= step;
if(min > (x+y)/2) then
min:= (x+y)/2;
writeln('Min: ', min);
end;
end;
end.
PascalABC.NET
begin
var (x, y) := ReadReal2('Введи х и у;');
var z: real;
if x <= 0 then
z := Max(x + y, x * y / 2)
else
z := Min(Sqrt(x * y), x + y * 2);
Print(z)
end.