Cod sursa(job #352874)

Utilizator cristian3991Udroiu Constantin Cristian cristian3991 Data 3 octombrie 2009 17:07:58
Problema Factorial Scor 5
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.37 kb
var i,j,k,p:int64;
    f:text;
begin
assign(f,'fact.in');
reset(f);
readln(f,p);
close(f);
i:=0;
k:=0;
while p>0 do
begin
inc(i,5);
if i mod 5=0 then if sqrt(i)=trunc(sqrt(i)) then dec(p,2)
                                            else dec(p);

end;
assign(f,'fact.out');
rewrite(f);
if p=0 then writeln(f,1)
       else write(f,i-5);
       close(f);
end.