Pagini recente » Cod sursa (job #1907025) | Cod sursa (job #208750) | Cod sursa (job #2841362) | Cod sursa (job #2656084) | Cod sursa (job #410857)
Cod sursa(job #410857)
const tfi='ciur.in';
tfo='ciur.out';
maxn=2000005;
var fi,fo:text;
cnt, i,j,n:longint;
dd:array[0..maxn] of byte;
begin
assign(fi,tfi); reset(fi);
assign(fo,tfo); rewrite(fo);
read(fi,n);
for i:=2 to n do
if dd[i]=0 then
begin
j:=i; inc(cnt);
while i+j<=n do
begin
j:=i+j; dd[j]:=1;
end;
end;
writeln(fo,cnt);
close(Fi); close(fo);
// writeln((datetimetotimestamp(now).time-tbegin.time)/1000:0:6);
end.