Cod sursa(job #291384)

Utilizator katamashCatalin Tamas katamash Data 29 martie 2009 18:51:16
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  ok:=false; end;
      end; write(f,-1);
close(f);end.