PascalABC.net
var x,y:real;
begin
write('Введите x: ');
readln(x);
if (x>=-2) and (x<=-1) then y:=2*x+4;<br>if (x>-1) and (x<=1) then y:=2*x*x;<br>if (x>1) and (x<=2) then y:=-2*x+2;<br>if (x<-2) or (x>2) then
writeln('Функция не определена')
else writeln('f(x)=',y);
end.