Pagini recente » Cod sursa (job #1059459) | Cod sursa (job #85047) | Cod sursa (job #2574649) | Diferente pentru problema/caibicol intre reviziile 4 si 5 | Cod sursa (job #123256)
Cod sursa(job #123256)
program factorial;
var p,n,x,y: real;
s : integer;
f : text;
begin
assign(f,'fact.in');
reset(f);
read(f,p);
close(f);
n := 1;
x := 1;
repeat
x := x+1;
n := n*x;
y := n;
s := 0;
while frac(y/10)=0 do begin
s := s+1;
y := y/10;
end;
until s=p;
assign(f,'frac.out');
rewrite(f);
write(f,x:1:0);
close(f);
end.