Pagini recente » Cod sursa (job #255807) | Cod sursa (job #2135610) | Cod sursa (job #3129734) | Cod sursa (job #93268) | Cod sursa (job #209277)
Cod sursa(job #209277)
program pascal;
var f,g:text;
i,d,n,nr,rez,j:longint;
v:array[1..2000000] of longint;
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.