Pagini recente » Cod sursa (job #1068189) | Cod sursa (job #864878) | Cod sursa (job #3254931) | Cod sursa (job #1548703) | Cod sursa (job #146961)
Cod sursa(job #146961)
var v:array [1..2000000] of integer;
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.