Pagini recente » Cod sursa (job #1753086) | Cod sursa (job #3227523) | Borderou de evaluare (job #1520482) | Cod sursa (job #309471) | Cod sursa (job #514243)
Cod sursa(job #514243)
const f='ciur.in';g='ciur.out';
nmax=100000000;
var
v:array[1..nmax] of integer;
n,i,j,cate:longint;
begin
assign(input,f);reset(input);
assign(output,g);rewrite(output);
read(n);
cate:=1;
i:=1;
while ((i*i) shr 1)+(i shr 1)<=n do
begin
if (v[i shl 3]=0)and(1 shr i=0)and(1 shr 7=0) then
begin
j:=((i*i)shl 1)+(i shl 1);
while ((j shl 1)+1 <=n) do
begin
v[j shr 3]:=v[j shr 3] or((1 shl j)and(1 shl 7));
end;
end;
end;
i:=1;
while 2*i+1<=n do
begin
if (v[i shr 3]=0) and (1 shl i=0) and (1 shl 7=0) then inc(cate);
i:=i+1;
end;
write(cate);
close(input);close(output);
end.