Cod sursa(job #1205890)

Utilizator Ysaika2Neacsu stefan Ysaika2 Data 8 iulie 2014 13:22:20
Problema Factorial Scor 0
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.43 kb
var p,i,j:longint;
    f,g:text;
begin
assign(f,'fact.in');
reset(f);
read(f,p); i:=1;
if p=0 then i:=1
else
repeat
i:=i+10;
if i mod 5=0 then j:=j+1;
if i mod 100=50  then j:=j+2;
if i mod 100=0 then j:=j+2;
if i mod 1000 =500 then j:=j+3;
if i mod 1000=0 then j:=j+3;
if i mod 10000=5000 then j:=j+4;
if i mod 10000=0 then j:=j+4;
until i<=p;
close(f);


assign(f,'fact.out'); rewrite(f);
write (f,j);
close(f);
end.