Function st(a:real;n:integer):real;
begin
if n=0
then st:=1
else if n<0 then st:=1/st(a,abs(n))<br> else st:=a*st(a,n-1);
end;
var x:real; k:integer;
begin
write('x = ');
readln(x);
write('k = ');
readln(k);
writeln(x,' ^ ',k,' = ',st(x,k));
end.
Пример:
x = 2
k = -3
2 ^ -3 = 0.125