function MyPower(x: real; n: integer): real;
var
i: integer;
begin
result := 1;
if n < 0 then
result := 1 / MyPower(x, -n)
else
for i := 1 to n do
result := result * x;
end;
x, y, p: real;
Write('x, y: ');
Read(x, y);
p := (2 * MyPower(x, 5) + 4 * MyPower(x, 30) + 8 * y)
/ (2 * y + MyPower(y, 15) - 25 * x);
Write('p = ', p);
end.
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
function MyPower(x: real; n: integer): real;
var
i: integer;
begin
result := 1;
if n < 0 then
result := 1 / MyPower(x, -n)
else
for i := 1 to n do
result := result * x;
end;
var
x, y, p: real;
begin
Write('x, y: ');
Read(x, y);
p := (2 * MyPower(x, 5) + 4 * MyPower(x, 30) + 8 * y)
/ (2 * y + MyPower(y, 15) - 25 * x);
Write('p = ', p);
end.