I am trying to input Z: 20202020 X: 202020 C: 2020
But after that, my terminal doesn't show anything. Why is that? I have tried with some other input and it works just fine.
Edit: I realized that the same problem occurs whenever the X input is more than 5 digit.
program PowerTower;
Uses Math;
var
x,
z: real;
c: int64;
hasil : real;
function pembulatan(o: real): int64;
begin
pembulatan:= Round(o);
end;
function dopower(h,y: real):
real;
begin
dopower:= power(h,y)
end;
function ayam(a, b: real) : real;
begin
begin
if (b=0) then
ayam := 1
else
ayam:= dopower(a,ayam(a, b-1));
end;
end;
begin
readln(z);
readln(x);
readln(c);
hasil:= ayam(z, x);
writeln(pembulatan(hasil) mod c);
readln;
end.