Pagini recente » Cod sursa (job #2488168) | Jobs | Cod sursa (job #3195879) | Cod sursa (job #753650) | Cod sursa (job #1980746)
Program Ciur;
var A:array[1..2000000] of boolean;
n,i,j,s,v,p:0..2000000;
f,g: text;
begin
assign(f,'ciur.in');
assign(g,'ciur.out');
reset(f);
rewrite(g);
readln(f,n);
for i:=1 to n do
A[i]:= true;
i:= 2;
while i<=n do begin
//p:=i*i;
if A[i] = true then begin
j:=1;
while i*j <= n do begin
A[i*j]:= false;
j:= j + 1;
end;
s:=s+1;
end;
i:= i+1;
end;
writeln(g,s);
readln;
close(f);
close(g);
end.