Var
X:real;
Begin
Write('X = ');ReadLn(X);
if abs(X)<=2 then Write('Y = ',X*X)<br>else Write('Y = ',1);
End.
или так:
Var
X,Y:real;
Begin
Write('X = ');
ReadLn(X);
if abs(X)<=2 then Y:=X*X<br>else Y:=1;
WriteLn('Y = ',Y)
End.
Первый запуск:
X = 1.3
Y = 1.69
Второй:
X = 2.71828
Y = 1
Третий:
X = -3.141592
Y = 1