Cod sursa(job #392539)
Utilizator | Data | 7 februarie 2010 18:15:45 | |
---|---|---|---|
Problema | Cifre | Scor | 0 |
Compilator | fpc | Status | done |
Runda | Arhiva de probleme | Marime | 0.6 kb |
var f,g:text;
a,b,i,n,m:longint;
c,k,j:byte;
begin
assign(f,'cifre.in');
reset(f);
read(f,a);
read(f,b);
read(f,c);
read(f,k);
close(f);
m:=0;
for i:=a to b do begin
n:=1;
j:=0;
repeat
if n mod 10=c then inc(j);
n:=n div 10
until n=0;
if j=k then inc(m);
end;
assign(g,'cifre.in');
rewrite(g);
writeln(g,1/m:10:4);
close(g);
end.