Pagini recente » Monitorul de evaluare | Diferente pentru problema/subpermutari intre reviziile 6 si 5 | Diferente pentru problema/ndap intre reviziile 34 si 33 | Cod sursa (job #1929742) | Cod sursa (job #157421)
Cod sursa(job #157421)
var n,x1,x,p,a,r:longint;
f,g:text;
begin
assign(f,'fact.in'); reset(f);
readln(f,p); close(f);
x:=1; n:=5; r:=0;
a:=0;
while p div x>=5 do
begin
x:=x*5+1;
n:=n*5;
end;
x1:=p div x;
r:=p mod x;
a:=n*x1+r*5;
assign(f,'fact.out'); rewrite(f);
writeln(f,a);
close(f);
end.