Pagini recente » Cod sursa (job #2987321) | Cod sursa (job #493020) | Cod sursa (job #1540149) | Cod sursa (job #176154) | Cod sursa (job #146964)
Cod sursa(job #146964)
var v:array [1..2000000] of byte;
n,i,j,k:longint;
begin
assign(input,'ciur.in'); reset(input);
assign(output,'ciur.out'); rewrite(output);
readln(n);
for i:=2 to n do
if v[i]=0 then begin
inc(k);
for j:=2 to n div i do v[i*j]:=1;
end;
writeln(k); j:=0; k:=k-1000;
for i:=2 to n do
if v[i]=0 then begin
inc(j);
if j>k then write(i,' ');
end;
close(input); close(output);
end.