//pascal
uses Math;
var
x, y : real;
begin
readln(x);
if (x >= 4) then
y := sqrt(power(x, 3) + 3 * power(x, 2) + 7.3)
else if (x > 2) and (x < 4) then
y := cos(2*x) - 1.5
else if (x <= 2) then
y := 5 * power(x, 2) -3;
writeln(y:5:2);
end.
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
//pascal
uses Math;
var
x, y : real;
begin
readln(x);
if (x >= 4) then
y := sqrt(power(x, 3) + 3 * power(x, 2) + 7.3)
else if (x > 2) and (x < 4) then
y := cos(2*x) - 1.5
else if (x <= 2) then
y := 5 * power(x, 2) -3;
writeln(y:5:2);
end.