Cod sursa(job #570253)

Utilizator armand2000Anusca Armand armand2000 Data 2 aprilie 2011 19:23:22
Problema Factorial Scor 5
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.32 kb
program factorial;
var p,n,i,j,k:longint;
    f,g:text;
begin
assign(f,'fact.in');
reset(f);
assign(g,'fact.out');
rewrite(g);
read(f,p);
k:=0;
for i:=0 to 100000 do
    begin
    if k=p then break;
    if i mod 5=0 then inc(k);
    j:=i;
    end;
if j=0 then j:=1;
write(g,j);
close(f);
close(g);
end.