function f(x:real):real;
begin
if x<=0 then f:=-x<br> else
if x<=1 then f:=x<br> else
if x<=3 then f:=1<br> else f:=4-x
end;
begin
Writeln('F(-0.7)=',f(-0.7));
Writeln('F(0.3)=',f(0.3));
Writeln('F(2.46)=',f(2.46));
Writeln('F(3.6)=',f(3.6))
end.
Результаты
F(-0.7)=0.7
F(0.3)=0.3
F(2.46)=1
F(3.6)=0.4