Cod sursa(job #2313862)

Utilizator cristina_exoCristina cristina_exo Data 7 ianuarie 2019 15:51:35
Problema Factorial Scor 15
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.48 kb
program cc; type tabel=array[1..1000000]of 0..1;
var a,i,x,y,n,b,max,min,m,j:longint;  t:tabel;
begin
assign(input,'fact.in');assign(output,'fact.out');reset(input);
rewrite(output);
readln(n);
if n=0 then write('1') else begin i:=1;
repeat
inc(i);
a:=i;
while a mod 2=0 do begin inc(x); a:=a div 2; end;
while a mod 5=0 do begin inc(y); a:=a div 5;end;
if x>y then m:=y else m:=x;
until m=n;
write(i);  end;
close(input); close(output);
end.