Cod sursa(job #291380)

Utilizator katamashCatalin Tamas katamash Data 29 martie 2009 18:47:17
Problema Factorial Scor 5
Compilator fpc Status done
Runda The Beginners Marime 0.34 kb
var ok:boolean; f:text; xx,x,i,fact,n:longint;
begin
ok:=true;
assign(f,'fact.in');reset(f);read(f,x);close(f);
assign(f,'fact.out');rewrite(f);
xx:=1;
for i:=1 to x do
    xx:=xx*10;
fact:=1;
    while ok=true do begin
    i:=i+1;
    fact:=fact*i;
    if fact mod xx=0 then begin write(f,i); ok:=false; end;
      end;
close(f);end.