program CalcY;
var
x, y, a: Double;
begin
Write ('Введите x и a: ');
ReadLn (x, a);
if (x > 0) and (x < a) then
y := Sqr (x)
else if x >= a then
y := x + a
else
y := Cos (x);
WriteLn ('y = ', y :20 :10);
ReadLn;
end.
program CalcY;
var
x, y, a: Double;
begin
Write ('Введите x и a: ');
ReadLn (x, a);
if (x > 0) and (x < a) then
y := Sqr (x)
else if x >= a then
y := x + a
else
y := Cos (x);
WriteLn ('y = ', y :20 :10);
ReadLn;
end.