Blame | Last modification | View Log | Download
program zamena;
uses crt;
var x,y : integer;
procedure swap(var x,y : integer);
var buf, buf2: integer;
begin
buf:=x;
x:=y;
y:=buf;
end;
function mocnina(R:double; E : integer ): double;
var i : integer;
var nasobek : double;
begin
if E > 0 then
begin
nasobek:=1;
for i:=1 to E do
begin
nasobek:=R*nasobek;
end;
mocnina:=nasobek;
end;
if E < 0 then
begin
nasobek:=1;
for i:=1 to abs(E) do
begin
nasobek:=(1/R)*nasobek;
end;
mocnina:=nasobek;
end;
if E=0 then mocnina:=1;
end;
procedure kruh(): double
var x,y: integer;
begin
for 0 to 1000000 do
begin
x:=random(0,1000);
y:=random(0,1000);
if sqrt(x pow(2) + y pow(2)) <= 1000; then n:= n+1;
kruh
end
end;
begin
clrscr;
randomized;
x:=1;
y:=2;
write('zadejte hodnoty zaklad, exponent');
readln(x);
readln(y);
write('x na y je:', mocnina(x,y));
readln;
swap(x,y);
end.