Pagini recente » Cod sursa (job #2030194) | Cod sursa (job #1287055) | Cod sursa (job #1286497) | Cod sursa (job #19574) | Cod sursa (job #584616)
Cod sursa(job #584616)
var s,x,g,p,t,i,j:longint;
st:string;
ok:boolean;
begin
assign(input,'fact.in');reset(input);
assign(output,'fact.out');rewrite(output);
read(p);
ok:=true;
s:=1;
while ok do begin
inc(x);
for i:=1 to x do
s:=s*i;
str(s,st);
for j:=1 to length(st)do begin
if st[j]='0' then t:=1;
if t=1 then inc(g);
end;
t:=0;
if g=p then ok:=false;
s:=1;
g:=0;
end;
write(x);
end.