Pagini recente » Diferente pentru problema/gardieni intre reviziile 8 si 7 | Diferente pentru problema/partitura intre reviziile 3 si 4 | Cod sursa (job #2220308) | Cod sursa (job #480345) | Cod sursa (job #209279)
Cod sursa(job #209279)
program pascal;
var f,g:text;
i,d,n,rez,j:longint;
v:array[1..2000001] of byte;
begin
assign(f,'ciur.in'); reset(f);
assign(g,'ciur.out'); rewrite(g);
read(f,n);
rez:=0;
for d:=2 to trunc(sqrt(n)) do
if v[d]=0 then
begin
for j:=2 to n div d do v[d*j]:=1;
end;
for i:=2 to n do
if v[i]=0 then inc(rez);
write(g,rez);
close(f);
close(g);
end.