pascalabcnet/TestSuite/CompilationSamples/Fun2.pas

17 lines
266 B
ObjectPascal
Raw Permalink Normal View History

// Функция Power
2015-05-14 22:35:07 +03:00
function Power(x: real; n: integer): real;
begin
Result := 1;
for var i:=1 to n do
Result *= x;
end;
var
x: real;
n: integer;
begin
x := 2; n := 5;
writelnFormat('{0} в степени {1} = {2}',x,n,Power(x,n));
2015-05-14 22:35:07 +03:00
end.