Код Pascal:
Var x:real;
Begin
Write('x = ');ReadLn(x);
if x <= 0 then Write('f(',x,') = ',17.9+x*x)<br>else if x <= 1 then Write('f(',x,') = ',Sqrt(x+2))<br> else Write('f(',x,') = ',Ln(x-1))
End.
Примеры работы программы:
x = -10
f(-10) = 117.9
x = 1
f(1) = 1.73205080756888
x = 3.7182818284590452353602874713527
f(3.71828182845905) = 1