Cod sursa(job #123257)

Utilizator free2infiltrateNezbeda Harald free2infiltrate Data 15 ianuarie 2008 09:33:29
Problema Factorial Scor 5
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.33 kb
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,'fact.out');
rewrite(f);
write(f,x:1:0);
close(f);
end.