Pagini recente » Cod sursa (job #942498) | Cod sursa (job #2625889) | Cod sursa (job #985377) | Cod sursa (job #1661042) | Cod sursa (job #625223)
Cod sursa(job #625223)
var f,g:text;
a:array[1..2000000]of 0..1;
n,b:longint;
function ciur(x:longint):longint;
var i,y,nr:longint;
begin
nr:=0;
for i:=2 to n do
if a[i]=0 then begin y:=i;
while y<=n do
begin
y:=y+i;
a[y]:=1;
end;
nr:=nr+1;
end;
ciur:=nr;
end;
begin
assign(f,'ciur.in'); assign(g,'ciur.out'); reset(f); rewrite(g);
read(f,n);
b:=ciur(n);
write(g,b);
close(f); close(g);
end.